for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EasyHttp\LayerContracts\Tests\Unit\Example;
use EasyHttp\LayerContracts\Contracts\HttpClientAdapter;
use EasyHttp\LayerContracts\Contracts\HttpClientRequest;
use EasyHttp\LayerContracts\Contracts\HttpClientResponse;
class ClientAdapter implements HttpClientAdapter
{
protected $handler;
public function setHandler(callable $handler): void
$this->handler = $handler;
}
public function request(HttpClientRequest $request): HttpClientResponse
$response = $this->call($request->getMethod(), $request->getUri());
return new ClientResponse($response);
private function call(string $method, string $uri): array
$method
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
private function call(/** @scrutinizer ignore-unused */ string $method, string $uri): array
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$uri
private function call(string $method, /** @scrutinizer ignore-unused */ string $uri): array
if ($this->handler) {
return call_user_func($this->handler);
return [
'status' => 200,
'headers' => ['Server' => 'Apache/2.4.38 (Debian)'],
'body' => '{"key":"value"}',
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.