1 | <?php |
||
10 | class Repository |
||
11 | { |
||
12 | /** |
||
13 | * Timezones. |
||
14 | * |
||
15 | * @var |
||
16 | */ |
||
17 | public $timezones; |
||
18 | |||
19 | /** |
||
20 | * Countries json. |
||
21 | * |
||
22 | * @var |
||
23 | */ |
||
24 | public $countriesJson; |
||
25 | |||
26 | /** |
||
27 | * Countries. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | public $countries = []; |
||
32 | |||
33 | /** |
||
34 | * Hydrator. |
||
35 | * |
||
36 | * @var Hydrator |
||
37 | */ |
||
38 | public $hydrator; |
||
39 | |||
40 | /** |
||
41 | * Helper. |
||
42 | * |
||
43 | * @var Helper |
||
44 | */ |
||
45 | private $helper; |
||
46 | |||
47 | /** |
||
48 | * Cache. |
||
49 | * |
||
50 | * @var Cache |
||
51 | */ |
||
52 | private $cache; |
||
53 | |||
54 | /** |
||
55 | * @var object |
||
56 | */ |
||
57 | private $config; |
||
58 | |||
59 | /** |
||
60 | * Repository constructor. |
||
61 | * |
||
62 | * @param CacheContract $cache |
||
63 | * @param Hydrator $hydrator |
||
64 | * @param Helper $helper |
||
65 | * @param object $config |
||
66 | */ |
||
67 | public function __construct(CacheContract $cache, Hydrator $hydrator, Helper $helper, $config) |
||
77 | |||
78 | /** |
||
79 | * Call magic method. |
||
80 | * |
||
81 | * @param $name |
||
82 | * @param array $arguments |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function __call($name, array $arguments = []) |
||
89 | |||
90 | /** |
||
91 | * Call a method currencies collection. |
||
92 | * |
||
93 | * @param $name |
||
94 | * @param $arguments |
||
95 | * @return bool|mixed |
||
96 | */ |
||
97 | public function call($name, $arguments) |
||
111 | |||
112 | /** |
||
113 | * @return Helper |
||
114 | */ |
||
115 | public function getHelper() |
||
119 | |||
120 | /** |
||
121 | * Hydrator getter. |
||
122 | * |
||
123 | * @return Hydrator |
||
124 | */ |
||
125 | public function getHydrator() |
||
129 | |||
130 | /** |
||
131 | * Boot the repository. |
||
132 | * @return static |
||
133 | */ |
||
134 | public function boot() |
||
140 | |||
141 | /** |
||
142 | * Load countries. |
||
143 | * |
||
144 | * @return \PragmaRX\Coollection\Package\Coollection |
||
145 | */ |
||
146 | public function loadCountries() |
||
158 | |||
159 | /** |
||
160 | * Load countries json file. |
||
161 | * @return \PragmaRX\Coollection\Package\Coollection |
||
162 | * @throws \Exception |
||
163 | */ |
||
164 | public function loadCountriesJson() |
||
176 | |||
177 | /** |
||
178 | * Load currency json file. |
||
179 | * |
||
180 | * @param $code |
||
181 | * @return string |
||
182 | */ |
||
183 | public function loadCurrenciesForCountry($code) |
||
191 | |||
192 | /** |
||
193 | * Get all countries. |
||
194 | * |
||
195 | * @return \PragmaRX\Coollection\Package\Coollection |
||
196 | */ |
||
197 | public function all() |
||
201 | |||
202 | /** |
||
203 | * Get all currencies. |
||
204 | * |
||
205 | * @return \PragmaRX\Coollection\Package\Coollection |
||
206 | */ |
||
207 | public function currencies() |
||
219 | |||
220 | /** |
||
221 | * Make flags array for a coutry. |
||
222 | * |
||
223 | * @param $country |
||
224 | * @return array |
||
225 | */ |
||
226 | public function makeAllFlags($country) |
||
246 | |||
247 | /** |
||
248 | * Read the flag SVG file. |
||
249 | * |
||
250 | * @param $country |
||
251 | * @return string |
||
252 | */ |
||
253 | public function getFlagSvg($country) |
||
259 | |||
260 | /** |
||
261 | * Get the SVG file path. |
||
262 | * |
||
263 | * @param $country |
||
264 | * @return string |
||
265 | */ |
||
266 | public function getFlagSvgPath($country) |
||
270 | |||
271 | /** |
||
272 | * Get country geometry. |
||
273 | * |
||
274 | * @param $country |
||
275 | * @return string |
||
276 | */ |
||
277 | public function getGeometry($country) |
||
283 | |||
284 | /** |
||
285 | * Get country topology. |
||
286 | * |
||
287 | * @param $country |
||
288 | * @return string |
||
289 | */ |
||
290 | public function getTopology($country) |
||
296 | |||
297 | /** |
||
298 | * Hydrate a country element. |
||
299 | * |
||
300 | * @param $collection |
||
301 | * @param null $elements |
||
302 | * @return \PragmaRX\Coollection\Package\Coollection |
||
303 | */ |
||
304 | public function hydrate($collection, $elements = null) |
||
308 | |||
309 | /** |
||
310 | * Find a country timezone. |
||
311 | * |
||
312 | * @param $countryCode |
||
313 | * @return null |
||
314 | */ |
||
315 | public function findTimezones($countryCode) |
||
321 | |||
322 | /** |
||
323 | * Find a country timezone. |
||
324 | * |
||
325 | * @param $zoneId |
||
326 | * @return \PragmaRX\Coollection\Package\Coollection |
||
327 | */ |
||
328 | public function findTimezoneTime($zoneId) |
||
334 | } |
||
335 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.