YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/Core/Auth.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

        $method = \App\Config::api('AUTH_METHOD');
Severity: Minor
Found in api/webservice/Core/Auth.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

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

    protected static $realm = 'YetiForceApi';
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

    public static function init(\Api\Controller $controller): Auth\AbstractAuth
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $method = \App\Config::api('AUTH_METHOD');
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        }
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $self = new $class();
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $class = "Api\\{$container}\\Auth\\{$method}";
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

    /**
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $self->authenticate(static::$realm);
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     * Realm.
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     *
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $self->setServer();
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     */
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     * Init.
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

    /**
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     * @var string
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

            $class = "Api\\Core\\Auth\\{$method}";
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        return $self;
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

    {
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     *
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     * @param \Api\Controller $controller
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     */
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        if (!class_exists($class)) {
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $self->setApi($controller);
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

        $container = $controller->request->getByType('_container', \App\Purifier::STANDARD);
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

    }
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     *
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

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

     * @return Auth\AbstractAuth
Severity: Minor
Found in api/webservice/Core/Auth.php by phpcodesniffer

There are no issues that match your filters.

Category
Status