Missing class import via use statement (line '23', column '14'). Open
$wfs = new VTWorkflowManager();
- 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
Missing class import via use statement (line '41', column '14'). Open
$wfs = new VTWorkflowManager();
- 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 'entityAfterUnLink'. Open
$recordModel = Vtiger_Record_Model::getInstanceById($params['destinationRecordId'], $params['destinationModule']);
- 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\Language' in method 'editViewPreSave'. Open
'message' => App\Language::translate('LBL_DATE_NOT_SHOULD_BE_GREATER_THAN_24H', $recordModel->getModuleName())
- 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\Fields\DateTime' in method 'editViewPreSave'. Open
if (\App\Fields\DateTime::getDiff($start, $end, 'minutes') > 24 * 60) {
- 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
Argument 2 (executionCondition)
is int
but \VTWorkflowManager::getWorkflowsForModule()
takes false|string
defined at /code/modules/com_vtiger_workflow/VTWorkflowManager.php:180
Open
$workflows = $wfs->getWorkflowsForModule($params['destinationModule'], VTWorkflowManager::$MANUAL);
- Exclude checks
Argument 2 (executionCondition)
is int
but \VTWorkflowManager::getWorkflowsForModule()
takes false|string
defined at /code/modules/com_vtiger_workflow/VTWorkflowManager.php:180
Open
$workflows = $wfs->getWorkflowsForModule($eventHandler->getModuleName(), VTWorkflowManager::$MANUAL);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class OSSTimeControl_TimeControl_Handler
- 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 10. Open
<?php
- Exclude checks
The class OSSTimeControl_TimeControl_Handler is not named in CamelCase. Open
class OSSTimeControl_TimeControl_Handler
{
/**
* EntityAfterUnLink handler function.
*
- 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
* @param App\EventHandler $eventHandler
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function entityAfterUnLink(App\EventHandler $eventHandler)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param App\EventHandler $eventHandler
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function entityAfterDelete(App\EventHandler $eventHandler)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param App\EventHandler $eventHandler
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = $eventHandler->getRecordModel();
- 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
$params = $eventHandler->getParams();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Vtiger_Record_Model::getInstanceById($params['destinationRecordId'], $params['destinationModule']);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$recordModel = Vtiger_Record_Model::getInstanceById($params['destinationRecordId'], $params['destinationModule']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$workflow->performTasks($recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param App\EventHandler $eventHandler
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$workflow->performTasks($recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* EntityBeforeSave handler function.
- 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
$response = [
- 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
*
- 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
'result' => false,
- 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
$response = [
- 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
foreach ($workflows as &$workflow) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$wfs = new VTWorkflowManager();
- 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
* EditViewPreSave handler function.
- 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
* EntityAfterSave handler function.
- 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
$workflows = $wfs->getWorkflowsForModule($eventHandler->getModuleName(), VTWorkflowManager::$MANUAL);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function editViewPreSave(App\EventHandler $eventHandler)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = $eventHandler->getRecordModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$start = $recordModel->get('date_start') . ' ' . $recordModel->get('time_start');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($workflow->evaluate($recordModel)) {
- 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
$workflows = $wfs->getWorkflowsForModule($params['destinationModule'], VTWorkflowManager::$MANUAL);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($workflows as &$workflow) {
- 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
$this->entityAfterSave($eventHandler);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function entityBeforeSave(App\EventHandler $eventHandler)
- 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
Line exceeds 120 characters; contains 126 characters Open
'message' => App\Language::translate('LBL_DATE_NOT_SHOULD_BE_GREATER_THAN_24H', $recordModel->getModuleName())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $response;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$wfs = new VTWorkflowManager();
- 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
if (\App\Fields\DateTime::getDiff($start, $end, 'minutes') > 24 * 60) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* EntityAfterDelete handler function.
- 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
$end = strtotime($recordModel->get('due_date') . ' ' . $recordModel->get('time_end'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('sum_time', round(abs(ceil((($end - $start) / 60) * 100) / 100), 0));
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param App\EventHandler $eventHandler
- 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 ($workflow->evaluate($recordModel)) {
- 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
* EntityChangeState handler function.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function entityChangeState(App\EventHandler $eventHandler)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* EntityAfterUnLink handler function.
- 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 App\EventHandler $eventHandler
- 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
$end = $recordModel->get('due_date') . ' ' . $recordModel->get('time_end');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'message' => App\Language::translate('LBL_DATE_NOT_SHOULD_BE_GREATER_THAN_24H', $recordModel->getModuleName())
- 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
public function entityAfterSave(App\EventHandler $eventHandler)
- 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
$recordModel = $eventHandler->getRecordModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$start = strtotime($recordModel->get('date_start') . ' ' . $recordModel->get('time_start'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->entityAfterSave($eventHandler);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'result' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Class name "OSSTimeControl_TimeControl_Handler" is not in camel caps format Open
class OSSTimeControl_TimeControl_Handler
- Exclude checks