1 | <?php |
||
10 | class Client |
||
11 | { |
||
12 | /** |
||
13 | * @var GuzzleClientInterface |
||
14 | */ |
||
15 | protected $httpClient; |
||
16 | |||
17 | /** |
||
18 | * This is the API username which you find/generate under Settings > API |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | private $username; |
||
23 | |||
24 | /** |
||
25 | * This is the API password which you find/generate under Settings > API |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $password; |
||
30 | |||
31 | /** |
||
32 | * This is the base url for the API |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $baseUrl = 'https://app.pakkelabels.dk/api/public/v3'; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | private $defaultOptions; |
||
42 | |||
43 | /** |
||
44 | * @var ResponseInterface |
||
45 | */ |
||
46 | private $lastResponse; |
||
47 | |||
48 | 15 | public function __construct($username, $password) |
|
54 | |||
55 | /** |
||
56 | * @param string $method |
||
57 | * @param string $uri |
||
58 | * @param array $options |
||
59 | * @return array |
||
60 | */ |
||
61 | 3 | public function doRequest($method, $uri, array $options = []) : array |
|
77 | |||
78 | /** |
||
79 | * @return GuzzleClientInterface |
||
80 | */ |
||
81 | 9 | public function getHttpClient() : GuzzleClientInterface |
|
88 | |||
89 | /** |
||
90 | * @param GuzzleClientInterface $httpClient |
||
91 | * @return Client |
||
92 | */ |
||
93 | 3 | public function setHttpClient(GuzzleClientInterface $httpClient) : self |
|
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | 6 | public function getUsername(): string |
|
106 | |||
107 | /** |
||
108 | * @param string $username |
||
109 | * @return Client |
||
110 | */ |
||
111 | 3 | public function setUsername(string $username) : self |
|
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | 6 | public function getPassword(): string |
|
124 | |||
125 | /** |
||
126 | * @param string $password |
||
127 | * @return Client |
||
128 | */ |
||
129 | 3 | public function setPassword(string $password) : self |
|
134 | |||
135 | /** |
||
136 | * @return string |
||
137 | */ |
||
138 | 3 | public function getBaseUrl() : string |
|
142 | |||
143 | /** |
||
144 | * @param string $baseUrl |
||
145 | * @return Client |
||
146 | */ |
||
147 | 3 | public function setBaseUrl(string $baseUrl) : self |
|
152 | |||
153 | /** |
||
154 | * @return array |
||
155 | */ |
||
156 | 6 | public function getDefaultOptions() : array |
|
160 | |||
161 | /** |
||
162 | * @param array $options |
||
163 | * @return Client |
||
164 | */ |
||
165 | 3 | public function setDefaultOptions(array $options) : self |
|
170 | |||
171 | /** |
||
172 | * @return ResponseInterface |
||
173 | */ |
||
174 | public function getLastResponse(): ResponseInterface |
||
178 | |||
179 | /** |
||
180 | * @param ResponseInterface $lastResponse |
||
181 | * @return Client |
||
182 | */ |
||
183 | public function setLastResponse(ResponseInterface $lastResponse) : self |
||
188 | |||
189 | 3 | protected function configureOptions(OptionsResolver $optionsResolver) |
|
207 | } |
||
208 |
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: