nopolabs/yabot

View on GitHub
src/Guzzle/GuzzleFactory.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\GuzzleHttp\Middleware' in method 'createHandlerStack'.
Open

        $stack->push(Middleware::prepareBody(), 'prepare_body');
Severity: Minor
Found in src/Guzzle/GuzzleFactory.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 '\GuzzleHttp\Middleware' in method 'createHandlerStack'.
Open

        $stack->push(Middleware::redirect(), 'allow_redirects');
Severity: Minor
Found in src/Guzzle/GuzzleFactory.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 '\GuzzleHttp\Middleware' in method 'createHandlerStack'.
Open

        $stack->push(Middleware::cookies(), 'cookies');
Severity: Minor
Found in src/Guzzle/GuzzleFactory.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

Call to method push from undeclared class \GuzzleHttp\HandlerStack
Open

        $stack->push(Middleware::redirect(), 'allow_redirects');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method push from undeclared class \GuzzleHttp\HandlerStack
Open

        $stack->push(Middleware::cookies(), 'cookies');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method cookies from undeclared class \GuzzleHttp\Middleware
Open

        $stack->push(Middleware::cookies(), 'cookies');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method createGuzzleClient from undeclared class \Nopolabs\ReactAwareGuzzleClientFactory
Open

        return $clientFactory->createGuzzleClient($this->eventLoop, $config, null, $this->logger);
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method __construct from undeclared class \GuzzleHttp\HandlerStack
Open

        $stack = new HandlerStack($handler);
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Return type of createHandlerStack() is undeclared type \GuzzleHttp\HandlerStack
Open

    public function createHandlerStack(CurlMultiHandler $handler) : HandlerStack
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method __construct from undeclared class \Nopolabs\ReactAwareGuzzleClientFactory
Open

        $clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method redirect from undeclared class \GuzzleHttp\Middleware
Open

        $stack->push(Middleware::redirect(), 'allow_redirects');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Parameter $handler has undeclared type \GuzzleHttp\Handler\CurlMultiHandler
Open

        $clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method push from undeclared class \GuzzleHttp\HandlerStack
Open

        $stack->push(Middleware::prepareBody(), 'prepare_body');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Parameter $logger has undeclared type ?\Psr\Log\LoggerInterface
Open

    public function __construct(LoopInterface $eventLoop, LoggerInterface $logger = null)
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Parameter $eventLoop has undeclared type \React\EventLoop\LoopInterface
Open

    public function __construct(LoopInterface $eventLoop, LoggerInterface $logger = null)
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Return type of newClient() is undeclared type \GuzzleHttp\Client (Did you mean class \Nopolabs\Yabot\Slack\Client)
Open

    public function newClient(array $config) : Client
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Parameter $handler has undeclared type \GuzzleHttp\Handler\CurlMultiHandler
Open

    public function createHandlerStack(CurlMultiHandler $handler) : HandlerStack
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method __construct from undeclared class \Psr\Log\NullLogger
Open

        $this->logger = $logger ?? new NullLogger();
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Call to method prepareBody from undeclared class \GuzzleHttp\Middleware
Open

        $stack->push(Middleware::prepareBody(), 'prepare_body');
Severity: Critical
Found in src/Guzzle/GuzzleFactory.php by phan

Expected 1 space after FUNCTION keyword; 0 found
Open

        $clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in src/Guzzle/GuzzleFactory.php by phpcodesniffer

There are no issues that match your filters.

Category
Status