Conditions | 5 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function toUnidimensional(Array $array, $glue) |
||
29 | { |
||
30 | $new_config = []; |
||
31 | $again = false; |
||
32 | |||
33 | foreach ($array as $param => $configure) |
||
34 | { |
||
35 | if (is_array($configure)) |
||
36 | { |
||
37 | foreach ($configure as $key => $value) |
||
38 | { |
||
39 | $again = true; |
||
40 | $new_config[$param . $glue . $key] = $value; |
||
41 | } |
||
42 | } |
||
43 | else |
||
44 | $new_config[$param] = $configure; |
||
45 | } |
||
46 | |||
47 | return (!$again) ? $new_config : self::toUnidimensional($new_config, $glue); |
||
48 | } |
||
79 | } |