YetiForceCompany/YetiForceCRM

View on GitHub
app/Map/Layer.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Config' in method 'getTileServer'.
Open

        $url = \App\Config::module('OpenStreetMap', 'tileLayerServer');
Severity: Minor
Found in app/Map/Layer.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

Reference to static property site_URL from undeclared class \Config\Main
Open

            $url = \Config\Main::$site_URL . 'file.php?module=OpenStreetMap&action=TileLayer&z={z}&x={x}&y={y}';
Severity: Critical
Found in app/Map/Layer.php by phan

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

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

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

        $url = \App\Config::module('OpenStreetMap', 'tileLayerServer');
Severity: Minor
Found in app/Map/Layer.php by phpcodesniffer

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

            $url = \Config\Main::$site_URL . 'file.php?module=OpenStreetMap&action=TileLayer&z={z}&x={x}&y={y}';
Severity: Minor
Found in app/Map/Layer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

        return $url;
Severity: Minor
Found in app/Map/Layer.php by phpcodesniffer

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

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

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

        if ('YetiForce' === $url) {
Severity: Minor
Found in app/Map/Layer.php by phpcodesniffer

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

     * Get url for tile server.
Severity: Minor
Found in app/Map/Layer.php by phpcodesniffer

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

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

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

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

There are no issues that match your filters.

Category
Status