| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | 19 | public static function flatArrayRecursive(?array $array): array |
|
| 15 | { |
||
| 16 | 19 | if (empty($array)) { |
|
| 17 | 1 | return []; |
|
| 18 | } |
||
| 19 | |||
| 20 | 19 | $resultArray = []; |
|
| 21 | |||
| 22 | 19 | foreach ($array as $key => $value) { |
|
| 23 | 19 | if (\is_array($value)) { |
|
| 24 | 19 | $resultArray = array_merge($resultArray, static::flatArrayRecursive($value)); |
|
| 25 | } else { |
||
| 26 | 19 | $resultArray[] = $value; |
|
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | 19 | return $resultArray; |
|
| 31 | } |
||
| 33 |