modules/Settings/Workflows/models/RecordStructure.php
Avoid using static access to class 'Vtiger_Loader' in method 'getInstanceForWorkFlowModule'. Open
Open
$className = Vtiger_Loader::getComponentClassName('Model', $mode . 'RecordStructure', 'Settings:Workflows');
- 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
Reference to undeclared property \Settings_Workflows_RecordStructure_Model->workFlowModel
Open
Open
return $this->workFlowModel;
- Exclude checks
Reference to undeclared property \Settings_Workflows_RecordStructure_Model->workFlowModel
(Did you mean $workFlowModel) Open
Open
$this->workFlowModel = $workFlowModel;
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model
- Exclude checks
The class Settings_Workflows_RecordStructure_Model is not named in CamelCase. Open
Open
class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model
{
/**
* Record structure default mode.
*
- 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
const RECORD_STRUCTURE_MODE_FILTER = 'Filter';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Set workflow model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function setWorkFlowModel($workFlowModel)
- 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
return $instance;
- 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 getWorkFlowModel()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $this->workFlowModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param string $mode
- 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
$instance = new $className();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param object $workFlowModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Get workflow model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return object
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
const RECORD_STRUCTURE_MODE_DEFAULT = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @var string
- 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 object
- 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 object $workFlowModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$className = Vtiger_Loader::getComponentClassName('Model', $mode . 'RecordStructure', 'Settings:Workflows');
- 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
* Record structure mode filter.
- 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
$instance->setModule($workFlowModel->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Record structure default mode.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$instance->setWorkFlowModel($workFlowModel);
- 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 instance for workflow module.
- 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
* @var string
- 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->workFlowModel = $workFlowModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function getInstanceForWorkFlowModule($workFlowModel, $mode)
- 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
Class name "Settings_Workflows_RecordStructure_Model" is not in camel caps format Open
Open
class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model
- Exclude checks