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 |
||
47 | */ |
||
48 | protected $response; |
||
49 | |||
50 | 2 | public function __construct(string $apiKey, string $baseUrl = 'https://api.linkmobility.dk/v2') |
|
57 | |||
58 | /** |
||
59 | * @param RequestInterface $request |
||
60 | * @return ResponseInterface |
||
61 | * @throws ExceptionInterface |
||
62 | */ |
||
63 | public function request(RequestInterface $request) : ResponseInterface |
||
68 | |||
69 | /** |
||
70 | * @param string $method |
||
71 | * @param string $uri |
||
72 | * @param array $body |
||
73 | * @param array $options |
||
74 | * @return array |
||
75 | * @throws ExceptionInterface |
||
76 | */ |
||
77 | 1 | public function rawRequest(string $method, string $uri, array $body = [], array $options = []) : array |
|
113 | |||
114 | /** |
||
115 | * @return ClientInterface |
||
116 | */ |
||
117 | 2 | public function getHttpClient() : ClientInterface |
|
124 | |||
125 | /** |
||
126 | * @param ClientInterface $httpClient |
||
127 | * @return Client |
||
128 | */ |
||
129 | 2 | public function setHttpClient(ClientInterface $httpClient) : Client |
|
134 | |||
135 | /** |
||
136 | * Returns the latest response or null if no request was made yet |
||
137 | * |
||
138 | * @return HttpResponseInterface|null |
||
139 | */ |
||
140 | 1 | public function getHttpResponse() |
|
144 | |||
145 | /** |
||
146 | * @return array |
||
147 | */ |
||
148 | public function getResponse() : array |
||
152 | |||
153 | 1 | protected function configureOptions(OptionsResolver $resolver) : void |
|
168 | |||
169 | /** |
||
170 | * Linkmobility always formats their errors like this, so we mimic this |
||
171 | * |
||
172 | * @param string|\Exception $error |
||
173 | * @param int $statusCode |
||
174 | */ |
||
175 | protected function setResponseError($error, int $statusCode = 500) : void |
||
184 | } |
||
185 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..