1 | <?php |
||
17 | class ProfileClient implements HttpClient, HttpAsyncClient |
||
18 | { |
||
19 | /** |
||
20 | * @var HttpClient|HttpAsyncClient |
||
21 | */ |
||
22 | private $client; |
||
23 | |||
24 | /** |
||
25 | * @var Collector |
||
26 | */ |
||
27 | private $collector; |
||
28 | |||
29 | /** |
||
30 | * @param HttpClient|HttpAsyncClient $client |
||
31 | * @param Collector $collector |
||
32 | */ |
||
33 | 4 | public function __construct($client, Collector $collector) |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function sendAsyncRequest(RequestInterface $request) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function sendRequest(RequestInterface $request) |
||
67 | |||
68 | /** |
||
69 | * @param RequestInterface $request |
||
70 | */ |
||
71 | private function collectRequestInformations(RequestInterface $request) |
||
81 | } |
||
82 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: