1 | <?php |
||
18 | class ProfileClient implements HttpClient, HttpAsyncClient |
||
19 | { |
||
20 | /** |
||
21 | * @var HttpClient|HttpAsyncClient |
||
22 | */ |
||
23 | private $client; |
||
24 | |||
25 | /** |
||
26 | * @var Collector |
||
27 | */ |
||
28 | private $collector; |
||
29 | |||
30 | /** |
||
31 | * @param HttpClient|HttpAsyncClient $client The client to profile. Client must implement both HttpClient and |
||
32 | * HttpAsyncClient interfaces. |
||
33 | * @param Collector $collector |
||
34 | */ |
||
35 | public function __construct($client, Collector $collector) |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function sendAsyncRequest(RequestInterface $request) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function sendRequest(RequestInterface $request) |
||
69 | |||
70 | /** |
||
71 | * @param RequestInterface $request |
||
72 | */ |
||
73 | private function collectRequestInformations(RequestInterface $request) |
||
83 | } |
||
84 |
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: