src/sql/ConnectionWrapper.php
Missing class import via use statement (line '59', column '23'). Open
Open
throw new \Exception("No method $method");
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method query has a boolean flag argument $params, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function query($query_text,$whichCon='',$params=false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The parameter $query_text is not named in camelCase. Open
Open
public function query($query_text,$whichCon='',$params=false)
{
$current = $this->connection->defaultDatabase($whichCon);
$this->connection->selectDB($this->dbName, $whichCon);
$ret = $this->connection->query($query_text, $whichCon='', $params);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The variable $query_text is not named in camelCase. Open
Open
public function query($query_text,$whichCon='',$params=false)
{
$current = $this->connection->defaultDatabase($whichCon);
$this->connection->selectDB($this->dbName, $whichCon);
$ret = $this->connection->query($query_text, $whichCon='', $params);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}