1 | <?php |
||
21 | final class HTTPlugConnection implements ConnectionInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var HttpClient |
||
25 | */ |
||
26 | private $client; |
||
27 | |||
28 | /** |
||
29 | * @var MessageFactory |
||
30 | */ |
||
31 | private $messageFactory; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | private $endpoint; |
||
37 | |||
38 | /** |
||
39 | * Initialize client. |
||
40 | * |
||
41 | * @param HttpClient $client |
||
42 | * @param MessageFactory $messageFactory |
||
43 | * @param string $endpoint |
||
44 | */ |
||
45 | public function __construct(HttpClient $client, MessageFactory $messageFactory, string $endpoint = ConnectionInterface::DEFAULT_ENDPOINT) |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function getPageBody(string $url, array $params = [], string $method = 'GET'): ?string |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function call(string $url, array $params = [], string $method = 'GET'): array |
||
93 | |||
94 | /** |
||
95 | * @param string $method |
||
96 | * @param string $url |
||
97 | * @param array $params |
||
98 | * |
||
99 | * @return RequestInterface |
||
100 | */ |
||
101 | private function createRequest(string $method, string $url, array $params): RequestInterface |
||
110 | |||
111 | /** |
||
112 | * @param ResponseInterface $response |
||
113 | * |
||
114 | * @throws ApiException |
||
115 | * |
||
116 | * @return array |
||
117 | */ |
||
118 | private function parseResponse(ResponseInterface $response): array |
||
128 | } |
||
129 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: