app/TextParser/DynamicInventoryColumnsTable.php
Avoid using static access to class '\App\Pdf\InventoryColumns' in method 'process'. Open
Open
'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),
- 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 method getParam
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
Open
$columns = $this->textParser->getParam('pdf')->getVariable('inventoryColumns');
- Exclude checks
Call to method getInventoryTable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
Open
$html = $this->textParser->getInventoryTable([
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
Open
'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
Open
if ($this->textParser->recordModel->getModule()->isInventory()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$html = $this->textParser->getInventoryTable([
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
]);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @author Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @copyright YetiForce S.A.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$columns = $this->textParser->getParam('pdf')->getVariable('inventoryColumns');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* Process.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
public function process()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
'type' => 'table',
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @return string
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
if ($this->textParser->recordModel->getModule()->isInventory()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$html = '';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
public $type = 'pdf';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
'href' => false,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @author Rafal Pospiech <r.pospiech@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
public $name = 'LBL_DYNAMIC_INVENTORY_TABLE';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
/** @var string Parser type */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
return $html;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @package App
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
* @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
/** @var string Class name */
- Exclude checks
Line exceeds 120 characters; contains 185 characters Open
Open
'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),
- Exclude checks