1 | <?php |
||
26 | class NumericBetween extends AbstractRule |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Contains the rule failure message |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $message = 'The field is not between the specified values.'; |
||
35 | |||
36 | /** |
||
37 | * @param mixed $value Value to validate |
||
38 | * @param string $field Unused by this rule |
||
39 | * @param array $allFields Unused by this rule |
||
40 | * |
||
41 | * @return bool |
||
42 | * |
||
43 | * @since 2.0 |
||
44 | */ |
||
45 | 10 | public function validate($value, $field = null, $allFields = null) |
|
59 | |||
60 | /** |
||
61 | * Returns true if the given params are not null, an array and has at least two values |
||
62 | * |
||
63 | * @param $params |
||
64 | * |
||
65 | * @return bool |
||
66 | * |
||
67 | * @since 2.0 |
||
68 | */ |
||
69 | 10 | protected function paramsValid($params) |
|
78 | |||
79 | /** |
||
80 | * Returns |
||
81 | * |
||
82 | * array( |
||
83 | * 'lowerBound' => <lower bound number>, |
||
84 | * 'upperBound' => <upper bound number>, |
||
85 | * ) |
||
86 | * |
||
87 | * @return string[] |
||
88 | * |
||
89 | * @since 2.0 |
||
90 | */ |
||
91 | 2 | public function getMessageParameters() |
|
113 | |||
114 | } |
||
115 |