| Conditions | 4 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 63 | public function flatten(array $config = null, $prefix = ''): array |
||
| 64 | { |
||
| 65 | $flattened = []; |
||
| 66 | |||
| 67 | if (null === $config) { |
||
| 68 | $config = $this->config; |
||
| 69 | } |
||
| 70 | |||
| 71 | foreach ($config as $key => $value) { |
||
| 72 | if (is_array($value)) { |
||
| 73 | $flattened += $this->flatten($value, $prefix . $key . '.'); |
||
| 74 | continue; |
||
| 75 | } |
||
| 76 | |||
| 77 | $flattened[$prefix . $key] = $value; |
||
| 78 | } |
||
| 79 | |||
| 80 | return $flattened; |
||
| 81 | } |
||
| 82 | } |
||
| 83 |