modules/com_vtiger_workflow/tasks/VTEntityMethodTask.php
Missing class import via use statement (line '36', column '8'). Open
Open
(new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);
- 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 'Vtiger_Record_Model' in method 'doTask'. Open
Open
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
- 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 \VTEntityMethodTask->methodName
Open
Open
(new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);
- Exclude checks
Reference to undeclared property \VTEntityMethodTask->workflowId
Open
Open
$moduleName = Settings_Workflows_Record_Model::getInstance($this->workflowId)->get('module_name');
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class VTEntityMethodTask extends VTTask
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 11. Open
Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Execute task.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function doTask($recordModel = null)
- 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 Vtiger_Record_Model $recordModel
- 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
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
(new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);
- 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 $executeImmediately = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getFieldNames()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$recordModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleName = Settings_Workflows_Record_Model::getInstance($this->workflowId)->get('module_name');
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return ['methodName'];
- 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 $recordEventState = self::RECORD_EVENT_DOUBLE_MODE;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks