Conditions | 4 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | public static function extractStrings(array $data): array |
||
49 | { |
||
50 | return array_reduce($data, function ($strings, $value) { |
||
51 | if (is_array($value)) { |
||
52 | return array_merge($strings, self::extractStrings($value)); |
||
53 | } elseif (is_string($value) && !is_numeric($value)) { |
||
54 | $strings[] = $value; |
||
55 | } |
||
56 | return $strings; |
||
57 | }, []); |
||
58 | } |
||
60 | } |