modules/Settings/TreesManager/models/Module.php
Avoid using static access to class 'Vtiger_Module_Model' in method 'getSupportedModules'. Open
Open
return Vtiger_Module_Model::getAll([0], [], true);
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks
The class Settings_TreesManager_Module_Model is not named in CamelCase. Open
Open
class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model
{
public $baseTable = 'vtiger_trees_templates';
public $baseIndex = 'id';
public $nameFields = ['name'];
- 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
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
*
- 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
}
- 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 getListViewUrl()
- 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 "javascript:Settings_TreesManager_List_Js.triggerCreate('index.php?module=TreesManager&parent=Settings&view=Edit')";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return string Url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get List view url.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return Vtiger_Module_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get Create view url.
- 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 $name = 'TreesManager';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Get supported modules.
- 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
*
- 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 getSupportedModules(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return Vtiger_Module_Model::getAll([0], [], true);
- 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 $baseTable = 'vtiger_trees_templates';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $baseIndex = 'id';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'index.php?module=' . $this->getName() . '&parent=' . $this->getParentName() . '&view=List';
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
Open
return "javascript:Settings_TreesManager_List_Js.triggerCreate('index.php?module=TreesManager&parent=Settings&view=Edit')";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $nameFields = ['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $listFields = ['name' => 'LBL_NAME', 'tabid' => 'LBL_MODULE'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return string Url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function getCreateRecordUrl()
- Exclude checks
Class name "Settings_TreesManager_Module_Model" is not in camel caps format Open
Open
class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks