Conditions | 5 |
Paths | 8 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
62 | public function flatten(array $config = null): array |
||
63 | { |
||
64 | $flattened = []; |
||
65 | |||
66 | if (null === $config) { |
||
67 | $config = $this->config; |
||
68 | } |
||
69 | |||
70 | foreach ($config as $key => $value) { |
||
71 | if (is_array($value)) { |
||
72 | $tmp = $this->flatten($value); |
||
73 | |||
74 | foreach ($tmp as $k => $v) { |
||
75 | $flattened[$key . '.' . $k] = $v; |
||
76 | } |
||
77 | |||
78 | continue; |
||
79 | } |
||
80 | |||
81 | $flattened[$key] = $value; |
||
82 | } |
||
83 | |||
84 | return $flattened; |
||
85 | } |
||
86 | } |