Avoid using static access to class '\App\Fields\Currency' in method 'process'. Open
$currency = \App\Fields\Currency::getById($rows['currency']);
- 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 '\Vtiger_Record_Model' in method 'process'. Open
$relatedRecordModel = \Vtiger_Record_Model::getInstanceById($this->textParser->recordModel->get($this->relatedModulesFields[$this->textParser->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\Double' in method 'process'. Open
return \App\Fields\Double::formatToDisplay($relatedRecordModel->get('sum_gross') - $this->textParser->recordModel->get('sum_gross')) . ' ' . $currency['currency_symbol'];
- 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 1 (value)
is float|int
but \App\Fields\Double::formatToDisplay()
takes null|string
defined at /code/app/Fields/Double.php:55
Open
return \App\Fields\Double::formatToDisplay($relatedRecordModel->get('sum_gross') - $this->textParser->recordModel->get('sum_gross')) . ' ' . $currency['currency_symbol'];
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
$temp = $this->textParser->recordModel->getInventoryData();
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
$relatedRecordModel = \Vtiger_Record_Model::getInstanceById($this->textParser->recordModel->get($this->relatedModulesFields[$this->textParser->recordModel->getModuleName()]));
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
return \App\Fields\Double::formatToDisplay($relatedRecordModel->get('sum_gross') - $this->textParser->recordModel->get('sum_gross')) . ' ' . $currency['currency_symbol'];
- Exclude checks
Line exceeds 120 characters; contains 183 characters Open
$relatedRecordModel = \Vtiger_Record_Model::getInstanceById($this->textParser->recordModel->get($this->relatedModulesFields[$this->textParser->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
public $type = 'pdf';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedRecordModel = \Vtiger_Record_Model::getInstanceById($this->textParser->recordModel->get($this->relatedModulesFields[$this->textParser->recordModel->getModuleName()]));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $name = 'LBL_AMOUNT_TO_RETURN';
- 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
/** @var array Allowed modules */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process()
- 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
$currency = \App\Fields\Currency::getById($rows['currency']);
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
return \App\Fields\Double::formatToDisplay($relatedRecordModel->get('sum_gross') - $this->textParser->recordModel->get('sum_gross')) . ' ' . $currency['currency_symbol'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var mixed Parser type */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Process.
- 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 $allowedModules = ['FCorectingInvoice'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $relatedModulesFields = ['FCorectingInvoice' => 'finvoiceid'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$temp = $this->textParser->recordModel->getInventoryData();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Related modules fields */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rows = reset($temp);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Fields\Double::formatToDisplay($relatedRecordModel->get('sum_gross') - $this->textParser->recordModel->get('sum_gross')) . ' ' . $currency['currency_symbol'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks