Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 15 |
Ratio | 100 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 0 |
1 | <?php |
||
39 | 1 | View Code Duplication | public function loadCountry($country) |
40 | { |
||
41 | 1 | if (!$country) { |
|
42 | return; |
||
43 | } |
||
44 | 1 | $file = $this->path.DIRECTORY_SEPARATOR.sprintf(self::COUNTRY_FILE, $country); |
|
45 | 1 | if (!file_exists($file)) { |
|
46 | return; |
||
47 | } |
||
48 | |||
49 | 1 | return json_decode( |
|
50 | file_get_contents($file), |
||
51 | 1 | true |
|
52 | ); |
||
53 | } |
||
54 | |||
76 |
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..