| Conditions | 6 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public static function normalize(array $list) |
||
| 24 | { |
||
| 25 | $proper = []; |
||
| 26 | foreach($list as $key => $value) |
||
| 27 | { |
||
| 28 | if(is_string($key) && is_bool($value)) |
||
| 29 | { |
||
| 30 | $key = str_replace(['(', ')'], '', $key); |
||
| 31 | $proper[$key] = $value; |
||
| 32 | } |
||
| 33 | elseif(is_numeric($key) && is_string($value)) |
||
| 34 | { |
||
| 35 | $value = str_replace(['(', ')'], '', $value); |
||
| 36 | $proper[$value] = true; |
||
| 37 | } |
||
| 38 | else |
||
| 39 | { |
||
| 40 | assert(false, "Unsupported list"); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | return $proper; |
||
| 44 | } |
||
| 45 | } |