YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Magento/Config.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

The method setScan has a boolean flag argument $id, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setScan(string $type, $name = false, $id = false): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method setScan has a boolean flag argument $name, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setScan(string $type, $name = false, $id = false): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class '\App\Cache' in method 'getAllServers'.
Open

        if (\App\Cache::has('Magento|getAllServers', '')) {
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

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\Cache' in method 'getAllServers'.
Open

        \App\Cache::save('Magento|getAllServers', '', $servers);
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

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

The method setScan uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $data = [
                'name' => $type . '_start_scan_date',
                'value' => date('Y-m-d H:i:s'),
            ];
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\App\Db' in method 'getAllServers'.
Open

        $dataReader = (new Query())->from('i_#__magento_servers')->createCommand(\App\Db::getInstance('admin'))->query();
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

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

The method setEndScan uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $dbCommand->update(self::TABLE_NAME, $data, ['server_id' => $this->get('id'), 'name' => $data['name']])->execute();
            }
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid using static access to class '\App\Cache' in method 'getAllServers'.
Open

            return \App\Cache::get('Magento|getAllServers', '');
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

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

Remove this unused "TABLE_NAME" private field.
Open

    private const TABLE_NAME = 'i_#__magento_config';

If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.

Noncompliant Code Example

class MyClass {
  private $foo = 4;                       //foo is unused

  public function compute($a) {
    return $a * 4;
  }
}

Compliant Solution

class MyClass {

  public function compute($a) {
    return $a * 4;
  }
}

See

Define a constant instead of duplicating this literal "server_id" 8 times.
Open

            (new Query())->select(['name', 'value'])->from(self::TABLE_NAME)->where(['server_id' => $serverId])->createCommand()->queryAllByGroup()
Severity: Critical
Found in app/Integrations/Magento/Config.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "value" 7 times.
Open

            (new Query())->select(['name', 'value'])->from(self::TABLE_NAME)->where(['server_id' => $serverId])->createCommand()->queryAllByGroup()
Severity: Critical
Found in app/Integrations/Magento/Config.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "Magento|getAllServers" 3 times.
Open

        if (\App\Cache::has('Magento|getAllServers', '')) {
Severity: Critical
Found in app/Integrations/Magento/Config.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Call to undeclared method \App\Db\Query::from
Open

        $dataReader = (new Query())->from('i_#__magento_servers')->createCommand(\App\Db::getInstance('admin'))->query();
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db::createCommand
Open

        $dbCommand = \App\Db::getInstance()->createCommand();
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

            $row['password'] = \App\Encryption::getInstance()->decrypt($row['password']);
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db::createCommand
Open

        $dbCommand = \App\Db::getInstance()->createCommand();
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db::createCommand
Open

        \App\Db::getInstance()->createCommand()->delete(self::TABLE_NAME, ['server_id' => $id])->execute();
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

@throws type of setScan has undeclared type \yii\db\Exception (Did you mean class \Exception)
Open

    public function setScan(string $type, $name = false, $id = false): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db\Query::from
Open

        if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db\Query::from
Open

            if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

Call to undeclared method \App\Db\Query::select
Open

            (new Query())->select(['name', 'value'])->from(self::TABLE_NAME)->where(['server_id' => $serverId])->createCommand()->queryAllByGroup()
Severity: Critical
Found in app/Integrations/Magento/Config.php by phan

@throws type of setEndScan has undeclared type \yii\db\Exception (Did you mean class \Exception)
Open

    public function setEndScan(string $type, string $date): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phan

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public static function getServer(int $id): array
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public function setScan(string $type, $name = false, $id = false): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public static function reload(int $id): void
Severity: Minor
Found in app/Integrations/Magento/Config.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get object to read configuration.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return self

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance->setData(array_merge(

Spaces must be used to indent lines; tabs are not allowed
Open

        if (false !== $name) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        return self::getAllServers()[$id] ?? [];

Spaces must be used to indent lines; tabs are not allowed
Open

            $servers[$serverId],

Spaces must be used to indent lines; tabs are not allowed
Open

        return $instance;

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool|int    $id

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => $type . '_last_scan_id',

Spaces must be used to indent lines; tabs are not allowed
Open

                $dbCommand->update(self::TABLE_NAME, $data, ['server_id' => $this->get('id'), 'name' => $data['name']])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getLastScan(string $type): array

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string      $type

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => "{$type}_last_scan_{$name}",

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {

Spaces must be used to indent lines; tabs are not allowed
Open

        $saveData = [

Spaces must be used to indent lines; tabs are not allowed
Open

        ];

Spaces must be used to indent lines; tabs are not allowed
Open

                $data['server_id'] = $this->get('id');

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $type

Spaces must be used to indent lines; tabs are not allowed
Open

            'id' => $this->get($type . '_last_scan_id') ?? 0,

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->set($data['name'], $data['value']);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            (new Query())->select(['name', 'value'])->from(self::TABLE_NAME)->where(['server_id' => $serverId])->createCommand()->queryAllByGroup()

Spaces must be used to indent lines; tabs are not allowed
Open

            ));

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool|string $name

Spaces must be used to indent lines; tabs are not allowed
Open

            $data = [

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => $type . '_end_scan_date',

Spaces must be used to indent lines; tabs are not allowed
Open

                $dbCommand->insert(self::TABLE_NAME, $data)->execute();

Line exceeds 120 characters; contains 131 characters
Open

                $dbCommand->update(self::TABLE_NAME, $data, ['server_id' => $this->get('id'), 'name' => $data['name']])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get last scan information.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    private const TABLE_NAME = 'i_#__magento_config';

Line exceeds 120 characters; contains 182 characters
Open

 * The file is part of the paid functionality. Using the file is allowed only after purchasing a subscription. File modification allowed only with the consent of the system producer.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            return \App\Cache::get('Magento|getAllServers', '');

Spaces must be used to indent lines; tabs are not allowed
Open

        return $servers;

Spaces must be used to indent lines; tabs are not allowed
Open

        $dataReader = (new Query())->from('i_#__magento_servers')->createCommand(\App\Db::getInstance('admin'))->query();

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $id

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get server by id.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance = new self();

Spaces must be used to indent lines; tabs are not allowed
Open

        $servers = self::getAllServers();

Line exceeds 120 characters; contains 147 characters
Open

            (new Query())->select(['name', 'value'])->from(self::TABLE_NAME)->where(['server_id' => $serverId])->createCommand()->queryAllByGroup()

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            ];

Spaces must be used to indent lines; tabs are not allowed
Open

            $data['server_id'] = $this->get('id');

Line exceeds 120 characters; contains 123 characters
Open

        $dbCommand->update(self::TABLE_NAME, $data, ['server_id' => $this->get('id'), 'name' => $data['name']])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $type

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Line exceeds 120 characters; contains 134 characters
Open

            if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$date) {

Spaces must be used to indent lines; tabs are not allowed
Open

        return [

Spaces must be used to indent lines; tabs are not allowed
Open

            ],

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $id

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Db::getInstance()->createCommand()->delete(self::TABLE_NAME, ['server_id' => $id])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

            $row['password'] = \App\Encryption::getInstance()->decrypt($row['password']);

Spaces must be used to indent lines; tabs are not allowed
Open

        $dataReader->close();

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::save('Magento|getAllServers', '', $servers);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws \yii\db\Exception

Spaces must be used to indent lines; tabs are not allowed
Open

            ];

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => $type . '_start_scan_date',

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set end scan.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * Table name.

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getInstance(int $serverId)

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $date

Spaces must be used to indent lines; tabs are not allowed
Open

                'value' => $date,

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            'end_date' => $this->get($type . '_end_scan_date') ?? false,

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws \yii\db\Exception

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

     * Reload integration with magento.

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function reload(int $id): void

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get all servers.

Spaces must be used to indent lines; tabs are not allowed
Open

        $servers = [];

Spaces must be used to indent lines; tabs are not allowed
Open

            $servers[$row['id']] = $row;

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getServer(int $id): array

Spaces must be used to indent lines; tabs are not allowed
Open

        if (\App\Cache::has('Magento|getAllServers', '')) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $serverId

Spaces must be used to indent lines; tabs are not allowed
Open

        while ($row = $dataReader->read()) {

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand = \App\Db::getInstance()->createCommand();

Spaces must be used to indent lines; tabs are not allowed
Open

                'value' => $id,

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            $dbCommand->insert(self::TABLE_NAME, $data)->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     * Save in db last scanned id.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            ], [

Spaces must be used to indent lines; tabs are not allowed
Open

            [

Spaces must be used to indent lines; tabs are not allowed
Open

            } else {

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

            'start_date' => $this->get($type . '_start_scan_date') ?? false,

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string[]

Spaces must be used to indent lines; tabs are not allowed
Open

            $data = [

Spaces must be used to indent lines; tabs are not allowed
Open

                'value' => date('Y-m-d H:i:s'),

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand->update(self::TABLE_NAME, $data, ['server_id' => $this->get('id'), 'name' => $data['name']])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->set($data['name'], $data['value']);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getAllServers(): array

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Line exceeds 120 characters; contains 121 characters
Open

        $dataReader = (new Query())->from('i_#__magento_servers')->createCommand(\App\Db::getInstance('admin'))->query();

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand = \App\Db::getInstance()->createCommand();

Spaces must be used to indent lines; tabs are not allowed
Open

            $date = date('Y-m-d H:i:s');

Spaces must be used to indent lines; tabs are not allowed
Open

                'value' => 0,

Spaces must be used to indent lines; tabs are not allowed
Open

            if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setScan(string $type, $name = false, $id = false): void

Line exceeds 120 characters; contains 130 characters
Open

        if (!(new Query())->from(self::TABLE_NAME)->where(['server_id' => $this->get('id'), 'name' => $data['name']])->exists()) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setEndScan(string $type, string $date): void

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($saveData as $data) {

Spaces must be used to indent lines; tabs are not allowed
Open

        ];

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            ));

There are no issues that match your filters.

Category
Status