Avoid using static access to class 'Settings_Vtiger_Module_Model' in method 'process'. Open
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
- 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 'Settings_Roles_Record_Model' in method 'process'. Open
$transferToRole = Settings_Roles_Record_Model::getInstanceById($transferRecordId);
- 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 'Settings_Roles_Record_Model' in method 'process'. Open
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
- 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 \Settings_Vtiger_Module_Model::getDefaultUrl
Open
$redirectUrl = $moduleModel->getDefaultUrl();
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Roles_Delete_Action extends Settings_Vtiger_Basic_Action
- Exclude checks
The class Settings_Roles_Delete_Action is not named in CamelCase. Open
class Settings_Roles_Delete_Action extends Settings_Vtiger_Basic_Action
{
public function process(App\Request $request)
{
$qualifiedModuleName = $request->getModule(false);
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$redirectUrl = $moduleModel->getDefaultUrl();
- 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
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$transferRecordId = $request->getByType('transfer_record', 'Alnum');
- 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
header("location: $redirectUrl");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->delete($transferToRole);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(App\Request $request)
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
if ($recordModel && $transferToRole && $recordId != $transferRecordId && false === strpos($transferToRole->get('parentrole') . '::', $recordModel->get('parentrole'))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = Settings_Vtiger_Module_Model::getInstance($qualifiedModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($recordModel && $transferToRole && $recordId != $transferRecordId && false === strpos($transferToRole->get('parentrole') . '::', $recordModel->get('parentrole'))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$transferToRole = Settings_Roles_Record_Model::getInstanceById($transferRecordId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordId = $request->getByType('record', 'Alnum');
- Exclude checks
Class name "Settings_Roles_Delete_Action" is not in camel caps format Open
class Settings_Roles_Delete_Action extends Settings_Vtiger_Basic_Action
- Exclude checks