Conditions | 2 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 1 | public static function process(array $collection = [], callable $callback = null): array |
|
38 | { |
||
39 | 1 | $func = function ($item) use (&$func, &$callback) { |
|
40 | 1 | return is_array($item) ? array_map($func, $item) : call_user_func($callback, $item); |
|
41 | 1 | }; |
|
42 | |||
43 | 1 | return array_map($func, $collection); |
|
44 | } |
||
46 |