| 1 | <?php |
||
| 20 | class BetweenRule extends AbstractCompareRule |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var mixed minimum value |
||
| 24 | */ |
||
| 25 | protected $minValue; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var mixed maximum value |
||
| 29 | */ |
||
| 30 | protected $maxValue; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Setup validation rule |
||
| 34 | * |
||
| 35 | * @param mixed $min |
||
| 36 | * @param mixed $max |
||
| 37 | * |
||
| 38 | * @throws \Bluz\Validator\Exception\ComponentException |
||
| 39 | */ |
||
| 40 | 27 | public function __construct($min, $max) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Check input data |
||
| 56 | * |
||
| 57 | * @param NumericRule $input |
||
| 58 | * |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | 24 | public function validate($input): bool |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Get error template |
||
| 69 | * |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | 16 | public function getDescription() : string |
|
| 76 | } |
||
| 77 |