| 1 | <?php |
||
| 18 | class Callback extends FilterRule |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var callable |
||
| 22 | */ |
||
| 23 | protected $callable; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Set callable closure |
||
| 27 | * |
||
| 28 | * @param callable $callable |
||
| 29 | * @param bool $allowNotSet |
||
| 30 | */ |
||
| 31 | 6 | public function __construct(callable $callable, $allowNotSet = false) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Execute the callable and provide a callback for the given value |
||
| 39 | * |
||
| 40 | * @param mixed $value |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | 5 | public function filter($value) |
|
| 47 | } |
||
| 48 |