1 | <?php |
||
17 | abstract class AbstractApiClient implements |
||
18 | ApiClientInterface, |
||
19 | LoggerAwareInterface |
||
20 | { |
||
21 | use LoggerAwareTrait; |
||
22 | |||
23 | /** |
||
24 | * @var ClientInterface The Guzzle HTTP client |
||
25 | */ |
||
26 | protected $httpClient; |
||
27 | |||
28 | /** |
||
29 | * @var Serializer The JMS Serializer instance |
||
30 | */ |
||
31 | protected $serializer; |
||
32 | |||
33 | /** |
||
34 | * ApiClient constructor. |
||
35 | * |
||
36 | * @param ClientInterface $httpClient |
||
37 | * @param Serializer $serializer |
||
38 | */ |
||
39 | 24 | public function __construct( |
|
40 | ClientInterface $httpClient, |
||
41 | Serializer $serializer |
||
42 | 4 | ) { |
|
43 | 24 | $this->httpClient = $httpClient; |
|
44 | 24 | $this->serializer = $serializer; |
|
45 | 24 | } |
|
46 | |||
47 | /** |
||
48 | * Perform the actual request in the implementation classes. |
||
49 | * |
||
50 | * @param string $method |
||
51 | * @param string $uri |
||
52 | * @param array $options |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | abstract protected function _doRequest($method, $uri, $options); |
||
57 | |||
58 | /** |
||
59 | * Make a request to the API and serialize the result according to our |
||
60 | * serialization strategy. |
||
61 | * |
||
62 | * @param string $method |
||
63 | * @param string $uri |
||
64 | * @param array $options |
||
65 | * @param object $serialisationClass |
||
66 | * |
||
67 | * @return array|\JMS\Serializer\scalar|mixed|object |
||
68 | */ |
||
69 | 6 | protected function makeRequest($method, $uri, $options, $serialisationClass = null) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 6 | public function getChannels($videoManagerId) |
|
106 | } |
||
107 |
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: