1 | <?php |
||
27 | class Utility implements UtilityInterface |
||
28 | { |
||
29 | /** |
||
30 | * Gets country code |
||
31 | * |
||
32 | * @param string $country Country name |
||
33 | * |
||
34 | * $return integer |
||
35 | */ |
||
36 | 2 | public function getCountryCode($country) |
|
42 | |||
43 | /** |
||
44 | * Gets municipality code |
||
45 | * |
||
46 | * @param string $municipality Municipality name |
||
47 | * |
||
48 | * $return integer |
||
49 | */ |
||
50 | 2 | public function getMunicipalityCode($municipality) |
|
56 | |||
57 | /** |
||
58 | * Remove spaces from phone number |
||
59 | * |
||
60 | * $param string $phone Phone number |
||
61 | * |
||
62 | * $return integer |
||
63 | */ |
||
64 | public function fixPhoneNumber($phonenumber) |
||
69 | |||
70 | |||
71 | /** |
||
72 | * Loops through csv file and stops with search |
||
73 | * |
||
74 | * @param $file_name |
||
75 | * @param $search |
||
76 | * @return array |
||
77 | */ |
||
78 | 4 | protected function getCSV($file_name, $search) |
|
91 | |||
92 | /** |
||
93 | * A version of in_array() that does a sub string match on $needle |
||
94 | * |
||
95 | * @param mixed $needle The searched value |
||
96 | * @param array $haystack The array to search in |
||
97 | * @return boolean |
||
98 | */ |
||
99 | private function substrInArray($needle, array $haystack) |
||
107 | } |
||
108 |
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.