1 | <?php |
||
13 | final class HttpMethodsClient implements HttpMethodsClientInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var ClientInterface |
||
17 | */ |
||
18 | private $httpClient; |
||
19 | |||
20 | /** |
||
21 | * @var RequestFactory|RequestFactoryInterface |
||
22 | */ |
||
23 | private $requestFactory; |
||
24 | |||
25 | /** |
||
26 | * @param RequestFactory|RequestFactoryInterface |
||
27 | */ |
||
28 | 8 | public function __construct(ClientInterface $httpClient, $requestFactory) |
|
39 | |||
40 | 1 | public function get($uri, array $headers = []): ResponseInterface |
|
44 | |||
45 | 1 | public function head($uri, array $headers = []): ResponseInterface |
|
49 | |||
50 | 1 | public function trace($uri, array $headers = []): ResponseInterface |
|
54 | |||
55 | 1 | public function post($uri, array $headers = [], $body = null): ResponseInterface |
|
59 | |||
60 | 1 | public function put($uri, array $headers = [], $body = null): ResponseInterface |
|
64 | |||
65 | 1 | public function patch($uri, array $headers = [], $body = null): ResponseInterface |
|
69 | |||
70 | 1 | public function delete($uri, array $headers = [], $body = null): ResponseInterface |
|
74 | |||
75 | 1 | public function options($uri, array $headers = [], $body = null): ResponseInterface |
|
79 | |||
80 | 8 | public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface |
|
89 | |||
90 | 8 | public function sendRequest(RequestInterface $request): ResponseInterface |
|
94 | } |
||
95 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.