| Conditions | 5 | 
| Paths | 5 | 
| Total Lines | 14 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 7 | 
| CRAP Score | 5.675 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 19 | 2 | public static function removeEmptyElementsRecursively(array $array): array | |
| 20 |     { | ||
| 21 | 2 | $result = $array; | |
| 22 | 2 |         foreach ($result as $key => $value) { | |
| 23 | 2 |             if (is_array($value)) { | |
| 24 | $result[$key] = self::removeEmptyElementsRecursively($value); | ||
| 25 |                 if ($result[$key] === []) { | ||
| 26 | unset($result[$key]); | ||
| 27 | } | ||
| 28 | 2 |             } elseif ($value === null) { | |
| 29 | 2 | unset($result[$key]); | |
| 30 | } | ||
| 31 | } | ||
| 32 | 2 | return $result; | |
| 33 | } | ||
| 35 |