1 | <?php declare(strict_types=1); |
||
15 | class Client |
||
16 | { |
||
17 | /** |
||
18 | * The API key used for making requests |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $apiKey; |
||
23 | |||
24 | /** |
||
25 | * The base url used for making requests |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $baseUrl; |
||
30 | |||
31 | /** |
||
32 | * The HTTP client used for making requests |
||
33 | * |
||
34 | * @var ClientInterface |
||
35 | */ |
||
36 | protected $httpClient; |
||
37 | |||
38 | /** |
||
39 | * Contains the last response object |
||
40 | * |
||
41 | * @var HttpResponseInterface|null |
||
42 | */ |
||
43 | protected $httpResponse; |
||
44 | |||
45 | /** |
||
46 | * @var array|string|int|bool |
||
47 | */ |
||
48 | protected $response; |
||
49 | |||
50 | 1 | public function __construct(string $apiKey, string $baseUrl = 'https://api.linkmobility.dk/v2') |
|
57 | |||
58 | /** |
||
59 | * @param RequestInterface $request |
||
60 | * @return ResponseInterface |
||
61 | * @throws GuzzleException |
||
62 | */ |
||
63 | public function request(RequestInterface $request) : ResponseInterface |
||
69 | |||
70 | /** |
||
71 | * @param string $method |
||
72 | * @param string $uri |
||
73 | * @param array $options |
||
74 | * @return mixed |
||
75 | */ |
||
76 | 1 | public function rawRequest(string $method, string $uri, array $options = []) |
|
109 | |||
110 | /** |
||
111 | * @return ClientInterface |
||
112 | */ |
||
113 | 1 | public function getHttpClient() : ClientInterface |
|
120 | |||
121 | /** |
||
122 | * @param ClientInterface $httpClient |
||
123 | * @return Client |
||
124 | */ |
||
125 | 1 | public function setHttpClient(ClientInterface $httpClient) : Client |
|
130 | |||
131 | /** |
||
132 | * Returns the latest response or null if no request was made yet |
||
133 | * |
||
134 | * @return HttpResponseInterface|null |
||
135 | */ |
||
136 | 1 | public function getHttpResponse() : ?HttpResponseInterface |
|
140 | |||
141 | /** |
||
142 | * @return array|bool|int|string |
||
143 | */ |
||
144 | public function getResponse() |
||
148 | |||
149 | 1 | protected function configureOptions(OptionsResolver $resolver) : void |
|
164 | |||
165 | protected function addResponseError(\Exception $exception, string $title, ?string $detail = null) : void |
||
185 | } |
||
186 |
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: