modules/Reservations/models/Module.php
Avoid using static access to class 'Vtiger_Link_Model' in method 'getSideBarLinks'. Open
Open
array_unshift($links['SIDEBARLINK'], Vtiger_Link_Model::getInstanceFromValues([
'linktype' => 'SIDEBARLINK',
'linklabel' => 'LBL_CALENDAR',
'linkurl' => $this->getCalendarViewUrl(),
'linkicon' => 'fas fa-calendar-alt'
- 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 Reservations_Module_Model extends Vtiger_Module_Model
- Exclude checks
The class Reservations_Module_Model is not named in CamelCase. Open
Open
class Reservations_Module_Model extends Vtiger_Module_Model
{
public function getCalendarViewUrl()
{
return 'index.php?module=' . $this->get('name') . '&view=Calendar';
- 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
$links = parent::getSideBarLinks($linkParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'index.php?module=' . $this->get('name') . '&view=Calendar';
- 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
}
- 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
array_unshift($links['SIDEBARLINK'], Vtiger_Link_Model::getInstanceFromValues([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linktype' => 'SIDEBARLINK',
- 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 string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getLayoutTypeForQuickCreate(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'standard';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getSideBarLinks($linkParams)
- 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
public function getDefaultViewName()
- 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
* Function to get the Default View Component Name.
- 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
public function getCalendarViewUrl()
- 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
'linkurl' => $this->getCalendarViewUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linklabel' => 'LBL_CALENDAR',
- 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' => 'fas fa-calendar-alt'
- 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 'Calendar';
- 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 "Reservations_Module_Model" is not in camel caps format Open
Open
class Reservations_Module_Model extends Vtiger_Module_Model
- Exclude checks