The method postProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
public function postProcess(App\Request $request, $display = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using static access to class 'Calendar_CalendarFilters_Model' in method 'postProcess'. Open
$viewer->assign('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());
- 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 'Calendar_Module_Model' in method 'process'. Open
'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),
- 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 'Calendar_Module_Model' in method 'process'. Open
'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),
- 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\Json' in method 'process'. Open
$viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([
'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),
'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),
]));
- 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 \Vtiger_Viewer::assign
Open
$viewer->assign('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SHOW_TYPE', true);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Calendar_Calendar_View extends Vtiger_Calendar_View
- Exclude checks
The class Calendar_Calendar_View is not named in CamelCase. Open
class Calendar_Calendar_View extends Vtiger_Calendar_View
{
/** {@inheritdoc} */
protected $filters = ['Events', 'Filter'];
- 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 for alignment; tabs are not allowed Open
]));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function postProcess(App\Request $request, $display = true)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
parent::postProcess($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$viewer->assign('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$viewer->assign('SHOW_TYPE', true);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
protected $filters = ['Events', 'Filter'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
parent::process($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function process(App\Request $request)
- Exclude checks
Class name "Calendar_Calendar_View" is not in camel caps format Open
class Calendar_Calendar_View extends Vtiger_Calendar_View
- Exclude checks