1 | <?php namespace Limoncello\Validation\Validator; |
||
45 | trait Comparisons |
||
46 | { |
||
47 | /** |
||
48 | * @param mixed $value |
||
49 | * |
||
50 | * @return RuleInterface |
||
51 | */ |
||
52 | protected static function equals($value): RuleInterface |
||
56 | |||
57 | /** |
||
58 | * @param mixed $value |
||
59 | * |
||
60 | * @return RuleInterface |
||
61 | */ |
||
62 | protected static function notEquals($value): RuleInterface |
||
66 | |||
67 | /** |
||
68 | * @param array $scalars |
||
69 | * |
||
70 | * @return RuleInterface |
||
71 | */ |
||
72 | protected static function inValues(array $scalars): RuleInterface |
||
76 | |||
77 | /** |
||
78 | * @param mixed $value |
||
79 | * |
||
80 | * @return RuleInterface |
||
81 | */ |
||
82 | protected static function lessThan($value): RuleInterface |
||
86 | |||
87 | /** |
||
88 | * @param mixed $value |
||
89 | * |
||
90 | * @return RuleInterface |
||
91 | */ |
||
92 | protected static function lessOrEquals($value): RuleInterface |
||
96 | |||
97 | /** |
||
98 | * @param mixed $value |
||
99 | * |
||
100 | * @return RuleInterface |
||
101 | */ |
||
102 | protected static function moreThan($value): RuleInterface |
||
106 | |||
107 | /** |
||
108 | * @param mixed $value |
||
109 | * |
||
110 | * @return RuleInterface |
||
111 | */ |
||
112 | protected static function moreOrEquals($value): RuleInterface |
||
117 | |||
118 | /** |
||
119 | * @param mixed $lowerLimit |
||
120 | * @param mixed $upperLimit |
||
121 | * |
||
122 | * @return RuleInterface |
||
123 | */ |
||
124 | protected static function between($lowerLimit, $upperLimit): RuleInterface |
||
129 | |||
130 | /** |
||
131 | * @param int $min |
||
132 | * @param int $max |
||
133 | * |
||
134 | * @return RuleInterface |
||
135 | */ |
||
136 | protected static function stringLengthBetween(int $min, int $max): RuleInterface |
||
140 | |||
141 | /** |
||
142 | * @param int $min |
||
143 | * |
||
144 | * @return RuleInterface |
||
145 | */ |
||
146 | protected static function stringLengthMin(int $min): RuleInterface |
||
150 | |||
151 | /** |
||
152 | * @param int $max |
||
153 | * |
||
154 | * @return RuleInterface |
||
155 | */ |
||
156 | protected static function stringLengthMax(int $max): RuleInterface |
||
160 | |||
161 | /** |
||
162 | * @param string $pattern |
||
163 | * |
||
164 | * @return RuleInterface |
||
165 | */ |
||
166 | protected static function regexp(string $pattern): RuleInterface |
||
170 | |||
171 | /** |
||
172 | * @param RuleInterface $rule |
||
173 | * |
||
174 | * @return RuleInterface |
||
175 | */ |
||
176 | protected static function nullable(RuleInterface $rule): RuleInterface |
||
180 | } |
||
181 |