YetiForceCompany/YetiForceCRM

View on GitHub
app/Map/Address.php

Summary

Maintainability
A
2 hrs
Test Coverage
D
65%

Function getActiveProviders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getActiveProviders(): array
    {
        if (self::$activeProvidersCache) {
            return self::$activeProvidersCache;
        }
Severity: Minor
Found in app/Map/Address.php - About 1 hr 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

Function getAllProviders has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllProviders(): array
    {
        if (self::$providersCache) {
            return self::$providersCache;
        }
Severity: Minor
Found in app/Map/Address.php - About 1 hr 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

Missing class import via use statement (line '83', column '17').
Open

        foreach ((new \DirectoryIterator(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'app/Map/Address')) as $fileinfo) {
Severity: Minor
Found in app/Map/Address.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 '120', column '17').
Open

        $query = (new \App\Db\Query())->from('s_#__address_finder_config');
Severity: Minor
Found in app/Map/Address.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

Avoid assigning values to variables in if clauses and the like (line '84', column '59').
Open

    public static function getAllProviders(): array
    {
        if (self::$providersCache) {
            return self::$providersCache;
        }
Severity: Minor
Found in app/Map/Address.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\Cache' in method 'getConfig'.
Open

        if (\App\Cache::has('AddressFinder', 'Config')) {
Severity: Minor
Found in app/Map/Address.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 getActiveProviders uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            foreach (self::getAllProviders() as $provider) {
                if ($provider->isActive()) {
                    self::$activeProvidersCache[] = $provider->getName();
                }
Severity: Minor
Found in app/Map/Address.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\YetiForce\Shop' in method 'getAllProviders'.
Open

                if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){
Severity: Minor
Found in app/Map/Address.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 'getConfig'.
Open

        \App\Cache::save('AddressFinder', 'Config', $config, \App\Cache::LONG);
Severity: Minor
Found in app/Map/Address.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 'getConfig'.
Open

            return \App\Cache::get('AddressFinder', 'Config');
Severity: Minor
Found in app/Map/Address.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

Define a constant instead of duplicating this literal "Config" 3 times.
Open

        if (\App\Cache::has('AddressFinder', 'Config')) {
Severity: Critical
Found in app/Map/Address.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 "AddressFinder" 3 times.
Open

        if (\App\Cache::has('AddressFinder', 'Config')) {
Severity: Critical
Found in app/Map/Address.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 method getName from undeclared class \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

                    self::$activeProvidersCache[] = $provider->getName();
Severity: Critical
Found in app/Map/Address.php by phan

Call to method isActive from undeclared class \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

                if ($provider->isActive()) {
Severity: Critical
Found in app/Map/Address.php by phan

Return type of getAllProviders() is undeclared type \App\Map\Address\Base[] (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

    public static function getAllProviders(): array
Severity: Minor
Found in app/Map/Address.php by phan

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

        $query = (new \App\Db\Query())->from('s_#__address_finder_config');
Severity: Critical
Found in app/Map/Address.php by phan

Call to method check from undeclared class \App\YetiForce\Shop
Open

                if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){
Severity: Critical
Found in app/Map/Address.php by phan

Return type of getInstance() is undeclared type \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

    public static function getInstance($type): Address\Base
Severity: Minor
Found in app/Map/Address.php by phan

Property \App\Map\Address::$providersCache has undeclared type \App\Map\Address\Base[] (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

    private static $providersCache = [];
Severity: Minor
Found in app/Map/Address.php by phan

Property \App\Map\Address::$providerInstanceCache has undeclared type \App\Map\Address\Base[] (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

    private static $providerInstanceCache = [];
Severity: Minor
Found in app/Map/Address.php by phan

Call to method getName from undeclared class \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

                    self::$activeProvidersCache[] = $provider->getName();
Severity: Critical
Found in app/Map/Address.php by phan

Call to method isActive from undeclared class \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

                if ($provider->isActive()) {
Severity: Critical
Found in app/Map/Address.php by phan

Avoid excessively long variable names like $providerInstanceCache. Keep variable name length under 20.
Open

    private static $providerInstanceCache = [];
Severity: Minor
Found in app/Map/Address.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

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

    {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        while ($row = $dataReader->read()) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            if ('php' === $fileinfo->getExtension() && 'Base' !== ($fileName = $fileinfo->getBasename('.php'))) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            return \App\Cache::get('AddressFinder', 'Config');
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (isset(self::$providerInstanceCache[$type])) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (self::$providersCache) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        $dataReader = $query->createCommand()->query();
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (!$defaultProvider) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    public static function getActiveProviders(): array
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                self::$providersCache[$fileName] = static::getInstance($fileName);
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            return self::$providerInstanceCache[$type];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * Get config for address finder.
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (\App\Cache::has('AddressFinder', 'Config')) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    private static $providerInstanceCache = [];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                    self::$activeProvidersCache[] = $provider->getName();
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        foreach ((new \DirectoryIterator(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'app/Map/Address')) as $fileinfo) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    public static function getDefaultProvider(): string
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @return string[]
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                if ($provider->isActive()) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @param string $type
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @return \App\Map\Address\Base
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    public static function getConfig(): array
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        $query = (new \App\Db\Query())->from('s_#__address_finder_config');
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        $config = [];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    private static $providersCache = [];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (self::$activeProvidersCache) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            return self::$activeProvidersCache;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * Get all providers for address finder.
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            foreach (self::getAllProviders() as $provider) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        $className = "\\App\\Map\\Address\\$type";
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /** @var \App\Map\Address\Base[] Providers cache. */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /** @var string[] Active providers cache. */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            return self::$providersCache;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        $defaultProvider = static::getConfig()['global']['default_provider'] ?? '';
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    /** @var Address\Base[] Providers instance cache. */
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * Get default provider.
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            $provider = static::getActiveProviders();
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        return $defaultProvider;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        if (self::$providersCache) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            foreach (self::$providersCache as $provider) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        } else {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * Get address finder instance by type.
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            if ($provider) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * Get active providers for address finder.
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                if ($provider->isActive()) {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

            $config[$row['type']][$row['name']] = $row['val'];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        return $config;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    private static $activeProvidersCache = [];
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                $defaultProvider = \current($provider);
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        return self::$activeProvidersCache;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

     * @return \App\Map\Address\Base[]
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    public static function getAllProviders(): array
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        return self::$providersCache;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        return self::$providerInstanceCache[$type] = new $className();
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

        \App\Cache::save('AddressFinder', 'Config', $config, \App\Cache::LONG);
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                    self::$activeProvidersCache[] = $provider->getName();
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

                    continue;
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

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

    public static function getInstance($type): Address\Base
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

Expected 1 space after IF keyword; 0 found
Open

                if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 0
Open

                if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){
Severity: Minor
Found in app/Map/Address.php by phpcodesniffer

There are no issues that match your filters.

Category
Status