YetiForceCompany/YetiForceCRM

View on GitHub
app/YetiForce/Shop.php

Summary

Maintainability
A
25 mins
Test Coverage
F
58%

Function verify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function verify(bool $getNames = false): string
    {
        $names = [];
        $products = \App\YetiForce\Register::getProducts();
        foreach ($products ?? [] as $row) {
Severity: Minor
Found in app/YetiForce/Shop.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

The class Shop has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
Open

final class Shop extends AbstractBase
{
    /** @var string URL */
    public const URL = 'https://api.yetiforce.eu/store';

Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '112', column '21').
Open

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '112', column '42').
Open

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '112', column '120').
Open

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '112', column '75').
Open

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

    public static function verify(bool $getNames = false): string
Severity: Minor
Found in app/YetiForce/Shop.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 'checkWithMessage'.
Open

            return Cache::staticGet('Shop|checkWithMessage', $productName);
Severity: Minor
Found in app/YetiForce/Shop.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 'checkWithMessage'.
Open

        if (Cache::staticHas('Shop|checkWithMessage', $productName)) {
Severity: Minor
Found in app/YetiForce/Shop.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\YetiForce\Register' in method 'getVariablePayments'.
Open

            'custom' => \App\YetiForce\Register::getInstanceKey() . '|' . \App\YetiForce\Register::getCrmKey(),
Severity: Minor
Found in app/YetiForce/Shop.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\YetiForce\Register' in method 'getVariablePayments'.
Open

            'custom' => \App\YetiForce\Register::getInstanceKey() . '|' . \App\YetiForce\Register::getCrmKey(),
Severity: Minor
Found in app/YetiForce/Shop.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\YetiForce\Register' in method 'checkWithMessage'.
Open

        $productDetails = \App\YetiForce\Register::getProduct($productName);
Severity: Minor
Found in app/YetiForce/Shop.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\Log' in method 'load'.
Open

            \App\Log::error($e->getMessage(), __METHOD__);
Severity: Minor
Found in app/YetiForce/Shop.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\Json' in method 'loadProduct'.
Open

                $this->setProducts([\App\Json::decode($client->getResponseBody())]);
Severity: Minor
Found in app/YetiForce/Shop.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\YetiForce\Register' in method 'verify'.
Open

        $products = \App\YetiForce\Register::getProducts();
Severity: Minor
Found in app/YetiForce/Shop.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\Json' in method 'load'.
Open

                $this->setProducts(\App\Json::decode($client->getResponseBody()));
Severity: Minor
Found in app/YetiForce/Shop.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\Json' in method 'loadProduct'.
Open

            if (!$this->error && 200 === $client->getStatusCode() && !\App\Json::isEmpty($client->getResponseBody())) {
Severity: Minor
Found in app/YetiForce/Shop.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\Json' in method 'load'.
Open

            if (!$this->error && 200 === $client->getStatusCode() && !\App\Json::isEmpty($client->getResponseBody())) {
Severity: Minor
Found in app/YetiForce/Shop.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 assigning values to variables in if clauses and the like (line '276', column '45').
Open

    private function setProducts(array $products)
    {
        foreach ($products as $productData) {
            $name = $productData['name'] ?? '';
            $className = self::getProductClass($name);
Severity: Minor
Found in app/YetiForce/Shop.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid using static access to class '\App\Version' in method 'load'.
Open

            $client->send(self::URL . '/' . \App\Version::get() . '/products', 'GET');
Severity: Minor
Found in app/YetiForce/Shop.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 getProduct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                (new self())->load();
            }
Severity: Minor
Found in app/YetiForce/Shop.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 'checkWithMessage'.
Open

        Cache::staticSave('Shop|checkWithMessage', $productName, [$status, $message]);
Severity: Minor
Found in app/YetiForce/Shop.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\Language' in method 'verify'.
Open

                    $names[$productName] = \App\Language::translate($productName, 'Settings::YetiForce');
Severity: Minor
Found in app/YetiForce/Shop.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\Version' in method 'loadProduct'.
Open

            $client->send(self::URL . '/' . \App\Version::get() . "/products/{$productId}", 'GET');
Severity: Minor
Found in app/YetiForce/Shop.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\Log' in method 'loadProduct'.
Open

            \App\Log::error($e->getMessage(), __METHOD__);
Severity: Minor
Found in app/YetiForce/Shop.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

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open

    public static array $productCache = [];
Severity: Critical
Found in app/YetiForce/Shop.php by phan

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

    /** @var string URL */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /** @var array Product categories. */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        'Integrations' => ['label' => 'LBL_CAT_INTEGRATIONS', 'icon' => 'yfi-integration-shop'],
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return $product->getStatus();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function checkWithMessage(string $productName): array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $status = $message = false;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if ($product->isExpired()) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                    $names[$productName] = \App\Language::translate($productName, 'Settings::YetiForce');
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /** @var string[] Premium icons. */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        1 => 'yfi-premium color-red-600',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    ];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $section
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * https://www.paypal.com/cgi-bin/webscr
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return implode(', ', $names);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        'Extensions' => ['label' => 'LBL_CAT_ADDONS', 'icon' => 'yfi-adds-on-shop'],
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $state
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function getVariablePayments(): array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $productDetails = \App\YetiForce\Register::getProduct($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        Cache::staticSave('Shop|checkWithMessage', $productName, [$status, $message]);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        2 => 'yfi-enterprise color-yellow-600',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Product instance cache.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'image_url' => 'https://public.yetiforce.com/shop/logo.png',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Check alert to show for product.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $className = self::getProductClass($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param bool $onlyNames
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return Shop\AbstractBaseProduct[]
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'rm' => 2,
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $product = new $className($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return $product->getAlertMessage();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return self::$productCache;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'cancel_return' => \Config\Main::$site_URL . 'index.php?module=YetiForce&parent=Settings&view=Shop&status=fail',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $product = new $className($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get paypal URL.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Verification of product with a message.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $names[$productName] = $productName;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'business' => 'paypal@yetiforce.com',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

            'cancel_return' => \Config\Main::$site_URL . 'index.php?module=YetiForce&parent=Settings&view=Shop&status=fail',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        ];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Verification of product.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param bool $getNames
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function verify(bool $getNames = false): string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        foreach ($products ?? [] as $row) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $product = new $className($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get all available products.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        3 => 'yfi-partners color-grey-600',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        'All' => ['label' => 'LBL_CAT_ALL', 'icon' => 'yfi-all-shop'],
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if (!$status) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function checkAlert(string $productName): string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $names = [];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return [
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $products = \App\YetiForce\Register::getProducts();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    ];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->load();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get variable payments.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return bool
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $productName
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function getPaypalUrl(): string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'return' => \Config\Main::$site_URL . 'index.php?module=YetiForce&parent=Settings&view=Shop&status=success',
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        if ($productDetails) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $message = 'LBL_SUBSCRIPTION_HAS_EXPIRED';
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                if (!$getNames) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public const PRODUCT_CATEGORIES = [
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get products.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $productName
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

Line exceeds 120 characters; contains 151 characters
Open

            $interval = (new \DateTime('now', new \DateTimeZone('GMT')))->diff(new \DateTime($productDetails['expires_at'], new \DateTimeZone('GMT')));
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $status = $interval->invert && $interval->days > 0;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return [$status, $message];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @todo remove or replace
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $className = self::getProductClass($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        try {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if (!$this->error && 200 === $client->getStatusCode() && !\App\Json::isEmpty($client->getResponseBody())) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public const URL = 'https://api.yetiforce.eu/store';
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public const PREMIUM_ICONS = [
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $className = self::getProductClass($productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            return Cache::staticGet('Shop|checkWithMessage', $productName);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $productName = $row['product'];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public function load()
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $this->success = false;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            \App\Log::error($e->getMessage(), __METHOD__);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $name
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $name
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static array $productCache = [];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        if (empty(self::$productCache)) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function check(string $productName): bool
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        if (Cache::staticHas('Shop|checkWithMessage', $productName)) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * https://www.sandbox.paypal.com/cgi-bin/webscr.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Verify or show a message about invalid products.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        try {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $this->success = false;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return Shop\AbstractBaseProduct
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

Line exceeds 120 characters; contains 130 characters
Open

            if (!empty($productData['packages']) && ($product = $className::fromArray($productData)) && $product->isAvailable()) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @var array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public function getProducts(): array
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            'custom' => \App\YetiForce\Register::getInstanceKey() . '|' . \App\YetiForce\Register::getCrmKey(),
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $productName
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return 'https://www.paypal.com/cgi-bin/webscr';
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return void
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $client = new ApiClient();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $className = self::getProductClass($name);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        self::$productCache = [];
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if (!$this->error && 200 === $client->getStatusCode() && !\App\Json::isEmpty($client->getResponseBody())) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->error = $client->getError();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        if (!class_exists($className)) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $productId
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    private static function getProductClass(string $name): string
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Set Products to cache.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $client->send(self::URL . '/' . \App\Version::get() . '/products', 'GET');
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return void
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->error = $e->getMessage();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get products.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get product class.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        foreach ($products as $productData) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if (!empty($productData['packages']) && ($product = $className::fromArray($productData)) && $product->isAvailable()) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->success = false;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                (new self())->loadProduct($productId);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $name = $productData['name'] ?? '';
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $this->setProducts(\App\Json::decode($client->getResponseBody()));
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public function loadProduct(string $productId)
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $this->success = true;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        } catch (\Throwable $e) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $section
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->error = $client->getError();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * Get product by ID.
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param string $productId
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        if (empty(self::$productCache[$name])) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $className = '\\App\\YetiForce\\Shop\\Product\\YetiForceBase';
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->error = $e->getMessage();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $this->setProducts([\App\Json::decode($client->getResponseBody())]);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    public static function getProduct(string $name, string $productId = ''): ?Shop\AbstractBaseProduct
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @return void
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                $this->success = true;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $this->success = false;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            \App\Log::error($e->getMessage(), __METHOD__);
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            if ($productId) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            } else {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $client = new ApiClient();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                (new self())->load();
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return self::$productCache[$name] ?? null;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        return $className;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        } catch (\Throwable $e) {
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            $client->send(self::URL . '/' . \App\Version::get() . "/products/{$productId}", 'GET');
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     * @param array $products
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

        $className = '\\App\\YetiForce\\Shop\\Product\\' . $name;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

    private function setProducts(array $products)
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

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

                self::$productCache[$product->getName()] = $product;
Severity: Minor
Found in app/YetiForce/Shop.php by phpcodesniffer

There are no issues that match your filters.

Category
Status