Avoid using static access to class '\GuzzleHttp\Middleware' in method 'createHandlerStack'. Open
$stack->push(Middleware::prepareBody(), 'prepare_body');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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');
- Exclude checks
Call to method push
from undeclared class \GuzzleHttp\HandlerStack
Open
$stack->push(Middleware::cookies(), 'cookies');
- Exclude checks
Call to method cookies
from undeclared class \GuzzleHttp\Middleware
Open
$stack->push(Middleware::cookies(), 'cookies');
- Exclude checks
Call to method createGuzzleClient
from undeclared class \Nopolabs\ReactAwareGuzzleClientFactory
Open
return $clientFactory->createGuzzleClient($this->eventLoop, $config, null, $this->logger);
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\HandlerStack
Open
$stack = new HandlerStack($handler);
- Exclude checks
Return type of createHandlerStack()
is undeclared type \GuzzleHttp\HandlerStack
Open
public function createHandlerStack(CurlMultiHandler $handler) : HandlerStack
- Exclude checks
Call to method __construct
from undeclared class \Nopolabs\ReactAwareGuzzleClientFactory
Open
$clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
- Exclude checks
Call to method redirect
from undeclared class \GuzzleHttp\Middleware
Open
$stack->push(Middleware::redirect(), 'allow_redirects');
- Exclude checks
Parameter $handler
has undeclared type \GuzzleHttp\Handler\CurlMultiHandler
Open
$clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
- Exclude checks
Call to method push
from undeclared class \GuzzleHttp\HandlerStack
Open
$stack->push(Middleware::prepareBody(), 'prepare_body');
- Exclude checks
Parameter $logger
has undeclared type ?\Psr\Log\LoggerInterface
Open
public function __construct(LoopInterface $eventLoop, LoggerInterface $logger = null)
- Exclude checks
Parameter $eventLoop
has undeclared type \React\EventLoop\LoopInterface
Open
public function __construct(LoopInterface $eventLoop, LoggerInterface $logger = null)
- Exclude checks
Return type of newClient()
is undeclared type \GuzzleHttp\Client
(Did you mean class \Nopolabs\Yabot\Slack\Client) Open
public function newClient(array $config) : Client
- Exclude checks
Parameter $handler
has undeclared type \GuzzleHttp\Handler\CurlMultiHandler
Open
public function createHandlerStack(CurlMultiHandler $handler) : HandlerStack
- Exclude checks
Call to method __construct
from undeclared class \Psr\Log\NullLogger
Open
$this->logger = $logger ?? new NullLogger();
- Exclude checks
Call to method prepareBody
from undeclared class \GuzzleHttp\Middleware
Open
$stack->push(Middleware::prepareBody(), 'prepare_body');
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
$clientFactory = new ReactAwareGuzzleClientFactory(function(CurlMultiHandler $handler) {
- Exclude checks
Expected 1 newline at end of file; 0 found Open
}
- Exclude checks