YetiForceCompany/YetiForceCRM

View on GitHub
app/TextParser/DynamicInventoryColumnsTable.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Pdf\InventoryColumns' in method 'process'.
Open

                'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),

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

            $columns = $this->textParser->getParam('pdf')->getVariable('inventoryColumns');

Call to method getInventoryTable from undeclared class \App\TextParser (Did you mean class \Tests\App\TextParser)
Open

            $html = $this->textParser->getInventoryTable([

Reference to instance property recordModel from undeclared class \App\TextParser
Open

                'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),

Reference to instance property recordModel from undeclared class \App\TextParser
Open

        if ($this->textParser->recordModel->getModule()->isInventory()) {

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

            $html = $this->textParser->getInventoryTable([

Spaces must be used for alignment; tabs are not allowed
Open

            ]);

Spaces must be used for alignment; tabs are not allowed
Open

 * @author        Radosław Skrzypczak <r.skrzypczak@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

 * @copyright    YetiForce S.A.

Spaces must be used for alignment; tabs are not allowed
Open

            $columns = $this->textParser->getParam('pdf')->getVariable('inventoryColumns');

Spaces must be used for alignment; tabs are not allowed
Open

     * Process.

Spaces must be used for alignment; tabs are not allowed
Open

    public function process()

Spaces must be used for alignment; tabs are not allowed
Open

                'type' => 'table',

Spaces must be used for alignment; tabs are not allowed
Open

                'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),

Spaces must be used for alignment; tabs are not allowed
Open

     * @return string

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

        if ($this->textParser->recordModel->getModule()->isInventory()) {

Spaces must be used for alignment; tabs are not allowed
Open

        $html = '';

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

    public $type = 'pdf';

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

                'href' => false,

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

 * @author         Rafal Pospiech <r.pospiech@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

    public $name = 'LBL_DYNAMIC_INVENTORY_TABLE';

Spaces must be used for alignment; tabs are not allowed
Open

    /** @var string Parser type */

Spaces must be used for alignment; tabs are not allowed
Open

        return $html;

Spaces must be used for alignment; tabs are not allowed
Open

 * @package     App

Spaces must be used for alignment; tabs are not allowed
Open

 * @license        YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

Spaces must be used for alignment; tabs are not allowed
Open

    /** @var string Class name */

Line exceeds 120 characters; contains 185 characters
Open

                'columns' => \App\Pdf\InventoryColumns::getInventoryColumnsForRecord($this->textParser->recordModel->getId(), $this->textParser->recordModel->getModuleName(), $columns),

There are no issues that match your filters.

Category
Status