1 | <?php |
||
27 | class Utility implements UtilityInterface |
||
28 | { |
||
29 | /** |
||
30 | * Gets country code |
||
31 | * |
||
32 | * $return integer |
||
33 | */ |
||
34 | 2 | public function getCountryCode($country) |
|
40 | |||
41 | /** |
||
42 | * Gets municipality code |
||
43 | * |
||
44 | * $return integer |
||
45 | */ |
||
46 | 2 | public function getMunicipalityCode($municipality) |
|
52 | |||
53 | /** |
||
54 | * Loops through csv file and stops with search |
||
55 | * |
||
56 | * @param $file_name |
||
57 | * @param $search |
||
58 | * @return array |
||
59 | */ |
||
60 | 4 | protected function getCSV($file_name, $search) |
|
73 | |||
74 | /** |
||
75 | * A version of in_array() that does a sub string match on $needle |
||
76 | * |
||
77 | * @param mixed $needle The searched value |
||
78 | * @param array $haystack The array to search in |
||
79 | * @return boolean |
||
80 | */ |
||
81 | private function substrInArray($needle, array $haystack) |
||
89 | } |
||
90 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.