1 | <?php |
||
6 | class Countries |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private static $file; |
||
12 | |||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private static $countries; |
||
17 | |||
18 | /** |
||
19 | * Sets the xml file to use to load countries |
||
20 | * |
||
21 | * @param string|null $file |
||
22 | * |
||
23 | * @throws RuntimeException |
||
24 | */ |
||
25 | 3 | public static function setXML($file = null) |
|
36 | |||
37 | /** |
||
38 | * Loads the countries from the xml file. |
||
39 | */ |
||
40 | 7 | private static function loadCountries() |
|
60 | |||
61 | /** |
||
62 | * Clears the data from the cache. |
||
63 | */ |
||
64 | 8 | public static function clearCache() |
|
68 | |||
69 | /** |
||
70 | * Checks if data has been cached |
||
71 | * |
||
72 | * @return boolean |
||
73 | */ |
||
74 | 1 | public static function isCached() |
|
78 | |||
79 | /** |
||
80 | * Returns array of countries |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | 1 | public static function getArray() |
|
92 | |||
93 | /** |
||
94 | * Returns countries as abbreviation=>name pair array |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | 3 | public static function getPairs() |
|
110 | |||
111 | /** |
||
112 | * Returns a single country by abbreviation |
||
113 | * |
||
114 | * @param string $country |
||
115 | * @param bool $name_only |
||
116 | * |
||
117 | * @return string|array|bool |
||
118 | */ |
||
119 | 3 | public static function getCountry($country, $name_only = true) |
|
131 | } |
||
132 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..