modules/Calendar/models/QuickCreateView.php
Avoid using static access to class 'Vtiger_Link_Model' in method 'getLinks'. Open
Open
$links['QUICKCREATE_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues([
'linktype' => 'QUICKCREATE_VIEW_HEADER',
'linkhint' => 'LBL_MARK_AS_HELD',
'linkicon' => 'far fa-square fa-lg mr-1 c-btn-checkbox--unchecked',
'linksecondicon' => 'far fa-check-square fa-lg mr-1 c-btn-checkbox--checked',
- 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 Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model
- Exclude checks
The class Calendar_QuickCreateView_Model is not named in CamelCase. Open
Open
class Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model
{
/** {@inheritdoc} */
public function getLinks(array $linkParams)
{
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getLinks(array $linkParams)
- 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
$links = parent::getLinks($linkParams);
- 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
'linkicon' => 'far fa-square fa-lg mr-1 c-btn-checkbox--unchecked',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $links;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkclass' => 'c-btn-checkbox c-btn-outline-done js-btn--mark-as-completed btn-group-toggle'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linktype' => 'QUICKCREATE_VIEW_HEADER',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'showLabel' => 1,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$links['QUICKCREATE_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linksecondicon' => 'far fa-check-square fa-lg mr-1 c-btn-checkbox--checked',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkhint' => 'LBL_MARK_AS_HELD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkdata' => ['js' => 'click', 'toggle' => 'buttons'],
- Exclude checks
Class name "Calendar_QuickCreateView_Model" is not in camel caps format Open
Open
class Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model
- Exclude checks