Total Complexity | 3 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class RecursiveMap |
||
20 | { |
||
21 | 1 | public function __invoke(array $collection = [], callable $callback = null): array |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Applies a callback function to each element of the given array recursively and returns a new array. |
||
28 | * |
||
29 | * @param array $collection The array to be processed. |
||
30 | * |
||
31 | * @param ?callable $callback The callback function to be applied to each array element. |
||
32 | * The callback function should accept one argument, which is the current array element, |
||
33 | * and can return a modified value for that element. |
||
34 | * |
||
35 | * @return array The processed array with the callback function applied to each element. |
||
36 | */ |
||
37 | 1 | public static function process(array $collection = [], callable $callback = null): array |
|
46 |