| 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) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Filter a given value with a new filter instance in a callable |
||
| 53 | * |
||
| 54 | * @param $value |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 1 | protected function filterValue($value) |
|
| 65 | } |
||
| 66 |