modules/Leads/summary_blocks/TotalEmails.php
Avoid using static access to class 'Vtiger_RelationListView_Model' in method 'process'. Open
Open
$relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $this->reference);
- 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 TotalEmails
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $name = 'Total emails';
- 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 $reference = 'OSSMailView';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function get number of emails.
- 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
* @return int - Number of emails
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return (int) $relationListView->getRelatedEntriesCount();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(Vtiger_Record_Model $recordModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $sequence = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $this->reference);
- 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
{
- Exclude checks