Avoid using undefined variables such as '$return' which will lead to PHP notices. Open
return $return;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$return' which will lead to PHP notices. Open
$return[$moduleName]['status'] = $status;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$return' which will lead to PHP notices. Open
$return[$moduleName]['id'] = $moduleId;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$return' which will lead to PHP notices. Open
$return[$moduleName]['id'] = $moduleId;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Missing class import via use statement (line '19', column '22'). Open
$dataReader = (new App\Db\Query())->from('vtiger_realization_process')
- 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
Avoid using static access to class '\App\Log' in method 'getStatusNotModify'. Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'updateStatusNotModify'. Open
'status_indicate_closing' => \App\Json::encode($status),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'updateStatusNotModify'. Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'getStatusNotModify'. Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'updateStatusNotModify'. Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'App\Module' in method 'getStatusNotModify'. Open
$moduleName = App\Module::getModuleName($moduleId);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'getStatusNotModify'. Open
$status = \App\Json::decode(html_entity_decode($row['status_indicate_closing']));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new App\Db\Query())->from('vtiger_realization_process')
- Exclude checks
Returning type true
but updateStatusNotModify()
is declared to return array
Open
return true;
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->update('vtiger_realization_process', [
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Exclude checks
Variable $return
was undeclared, but array fields are being added to it. Open
$return[$moduleName]['id'] = $moduleId;
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Exclude checks
Avoid excessively long class names like Settings_RealizationProcesses_Module_Model. Keep class name length under 40. Open
class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
{
/**
* Gets status.
*
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks
The class Settings_RealizationProcesses_Module_Model is not named in CamelCase. Open
class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
{
/**
* Gets status.
*
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleId = $row['module_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return[$moduleName]['status'] = $status;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return[$moduleName]['id'] = $moduleId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $moduleId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return[$moduleName]['id'] = $moduleId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new App\Db\Query())->from('vtiger_realization_process')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], ['module_id' => $moduleId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function updateStatusNotModify($moduleId, $status)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = [$status];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets status.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'status_indicate_closing' => \App\Json::encode($status),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Update status.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = App\Module::getModuleName($moduleId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array - array of status
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = \App\Json::decode(html_entity_decode($row['status_indicate_closing']));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $status
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\is_array($status)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Db::getInstance()->createCommand()->update('vtiger_realization_process', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array - array of status
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getStatusNotModify()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');
- Exclude checks
Class name "Settings_RealizationProcesses_Module_Model" is not in camel caps format Open
class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks