1 | <?php |
||
19 | class Each extends FilterRule |
||
20 | { |
||
21 | /** |
||
22 | * @var callable |
||
23 | */ |
||
24 | protected $callable; |
||
25 | |||
26 | /** |
||
27 | * @param callable $callable |
||
28 | */ |
||
29 | 2 | public function __construct(callable $callable) |
|
33 | |||
34 | /** |
||
35 | * When provided with an array, the callback filter will be executed for every value |
||
36 | * |
||
37 | * @param mixed $values |
||
38 | * @return array |
||
39 | */ |
||
40 | 2 | public function filter($values) |
|
52 | |||
53 | /** |
||
54 | * Filter a given value with a new filter instance in a callable |
||
55 | * |
||
56 | * @param $value |
||
57 | * @return array |
||
58 | */ |
||
59 | 1 | protected function filterValue($value) |
|
67 | } |
||
68 |