Total Complexity | 1 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait Filter |
||
12 | { |
||
13 | /** |
||
14 | * Filters elements of an array using a callback function. |
||
15 | * |
||
16 | * Iterates over each value in the array passing them to the `callback` function. If the callback functions returns |
||
17 | * true the current value from the array stays in the array, otherwise they are removed. Array keys are preserved. |
||
18 | * |
||
19 | * @param callable $callback the callback function to use |
||
20 | * |
||
21 | * @return self |
||
22 | */ |
||
23 | 2 | public function filter(callable $callback): self |
|
30 |