1 | <?php |
||
12 | final class Client implements ClientInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $accessToken; |
||
18 | |||
19 | /** |
||
20 | * @var HttpClientInterface |
||
21 | */ |
||
22 | private $httpClient; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private static $httpOptions = [ |
||
28 | 'base_uri' => 'https://api.esa.io/v1/', |
||
29 | 'timeout' => 60, |
||
30 | 'allow_redirect' => false, |
||
31 | 'headers' => [ |
||
32 | 'User-Agent' => 'esa-php-api v2', |
||
33 | 'Accept' => 'application/json', |
||
34 | ], |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * @param string $accessToken |
||
39 | * @param HttpClientInterface $httpClient |
||
40 | */ |
||
41 | public function __construct($accessToken, HttpClientInterface $httpClient) |
||
46 | |||
47 | /** |
||
48 | * @param string $method |
||
49 | * @param string $path |
||
50 | * @param array $data |
||
51 | * |
||
52 | * @return array |
||
53 | * |
||
54 | * @throws ApiErrorException |
||
55 | */ |
||
56 | public function request($method, $path, array $data = []) |
||
66 | |||
67 | public static function factory($accessToken, $httpOptions = []) |
||
74 | |||
75 | private static function createAuthStack($accessToken) |
||
84 | } |
||
85 |
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: