| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class LessRule extends AbstractCompareRule |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var mixed maximum value |
||
| 23 | */ |
||
| 24 | protected $maxValue; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Setup validation rule |
||
| 28 | * |
||
| 29 | * @param mixed $maxValue |
||
| 30 | */ |
||
| 31 | 16 | public function __construct($maxValue) |
|
| 34 | 16 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Check input data |
||
| 38 | * |
||
| 39 | * @param NumericRule $input |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | 16 | public function validate($input): bool |
|
| 44 | { |
||
| 45 | 16 | return $this->less($input, $this->maxValue); |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get error template |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 7 | public function getDescription(): string |
|
| 56 | } |
||
| 57 | } |
||
| 58 |