1 | <?php |
||
8 | class Tmdb implements Interfaces\TmdbInterface |
||
9 | { |
||
10 | |||
11 | // Private variables |
||
12 | private $api_key = null; // API Key |
||
13 | private $language = 'fr-FR'; // Default language for API response |
||
14 | public $base_api_url = 'https://api.themoviedb.org/3/'; // Base URL of the API |
||
15 | private $include_adult = false; // Include adult content in search result |
||
16 | private $page = 1; // API Page result |
||
17 | // Protected variables |
||
18 | protected $configuration = null; // API Configuration |
||
19 | protected $genres = null; // API Genres |
||
20 | |||
21 | /** |
||
22 | * Constructor |
||
23 | * @param string $api_key TMDB API Key |
||
24 | */ |
||
25 | |||
26 | 127 | public function __construct(string $api_key) |
|
30 | |||
31 | /** |
||
32 | * Send cUrl request to TMDB API |
||
33 | * @param Interfaces\HttpRequestInterface $http_request |
||
34 | * @param string $action API action to request |
||
35 | * @param string $query Query of the request (optional) |
||
36 | * @param array $options Array of options of the request (optional) |
||
37 | * @return \stdClass |
||
38 | */ |
||
39 | 5 | public function sendRequest(Interfaces\HttpRequestInterface $http_request, string $action, string $query = null, array $options = array()): \stdClass |
|
93 | |||
94 | /** |
||
95 | * Get API Configuration |
||
96 | * @return \stdClass |
||
97 | */ |
||
98 | 8 | public function getConfiguration(): \stdClass |
|
113 | |||
114 | /** |
||
115 | * Check options rules before send request |
||
116 | * @param array $options Array of options to validate |
||
117 | * @return array |
||
118 | * @throws \Exception |
||
119 | */ |
||
120 | 119 | public function checkOptions(array $options): array |
|
150 | |||
151 | /** |
||
152 | * Check year format |
||
153 | * @param mixed $year year to validate |
||
154 | * @return int year validated |
||
155 | * @throws \Exception |
||
156 | */ |
||
157 | 1 | private function checkYear(int $year): int |
|
162 | |||
163 | /** |
||
164 | * Check language |
||
165 | * @param string $language Language string with format ISO 639-1 |
||
166 | * @return string Language string validated |
||
167 | * @throws \Exception |
||
168 | */ |
||
169 | 44 | private function checkLanguage(string $language): string |
|
178 | |||
179 | } |
||
180 |
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: