1 | <?php |
||
18 | abstract class HttpClientPool implements HttpClientPoolInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var HttpClientPoolItem[] |
||
22 | */ |
||
23 | protected $clientPool = []; |
||
24 | |||
25 | /** |
||
26 | * Add a client to the pool. |
||
27 | * |
||
28 | * @param ClientInterface|HttpAsyncClient|HttpClientPoolItem $client |
||
29 | */ |
||
30 | 14 | public function addHttpClient($client): void |
|
44 | |||
45 | /** |
||
46 | * Return an http client given a specific strategy. |
||
47 | * |
||
48 | * @throws HttpClientNotFoundException When no http client has been found into the pool |
||
49 | * |
||
50 | * @return HttpClientPoolItem Return a http client that can do both sync or async |
||
51 | */ |
||
52 | abstract protected function chooseHttpClient(): HttpClientPoolItem; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 6 | public function sendAsyncRequest(RequestInterface $request) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 14 | public function sendRequest(RequestInterface $request): ResponseInterface |
|
69 | } |
||
70 |
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.