| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public static function normalize($arr){ |
||
| 22 | |||
| 23 | $keys = array_keys($arr); |
||
| 24 | $count = count($keys); |
||
| 25 | |||
| 26 | $newArr = []; |
||
| 27 | for ($i = 0; $i < $count; $i++) { |
||
| 28 | if (is_int($keys[$i])) { |
||
| 29 | $newArr[$arr[$keys[$i]]] = null; |
||
| 30 | } else { |
||
| 31 | $newArr[$keys[$i]] = $arr[$keys[$i]]; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | return $newArr; |
||
| 35 | } |
||
| 36 | |||
| 60 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.