app/Conditions/QueryFields/CurrencyListField.php
The method getOrderBy has a boolean flag argument $order, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function getOrderBy($order = false): array
- 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
Call to method addJoin
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
Open
$this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);
- Exclude checks
Default value for string
$order
can't be false
Open
Open
public function getOrderBy($order = false): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return ['vtiger_currency_info.currency_name' => SORT_ASC];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Get order by.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($order && 'desc' === strtolower($order)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param string $order
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getOrderBy($order = false): array
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
Open
$this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return ['vtiger_currency_info.currency_name' => SORT_DESC];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks