@@ -113,7 +113,7 @@ public static function formatMessage(Rule $rule, bool $withValue = true): string
113113 /**
114114 * Is control's value equal with second parameter?
115115 */
116- public static function validateEqual (Control $ control , $ arg ): bool
116+ public static function validateEqual (Control $ control , mixed $ arg ): bool
117117 {
118118 $ value = $ control ->getValue ();
119119 $ values = is_array ($ value ) ? $ value : [$ value ];
@@ -140,7 +140,7 @@ public static function validateEqual(Control $control, $arg): bool
140140 /**
141141 * Is control's value not equal with second parameter?
142142 */
143- public static function validateNotEqual (Control $ control , $ arg ): bool
143+ public static function validateNotEqual (Control $ control , mixed $ arg ): bool
144144 {
145145 return !static ::validateEqual ($ control , $ arg );
146146 }
@@ -199,7 +199,7 @@ public static function validateRange(Control $control, array $range): bool
199199 /**
200200 * Is a control's value number greater than or equal to the specified minimum?
201201 */
202- public static function validateMin (Control $ control , $ minimum ): bool
202+ public static function validateMin (Control $ control , int | float | string | \ DateTimeInterface $ minimum ): bool
203203 {
204204 return Validators::isInRange ($ control ->getValue (), [$ minimum === '' ? null : $ minimum , null ]);
205205 }
@@ -208,7 +208,7 @@ public static function validateMin(Control $control, $minimum): bool
208208 /**
209209 * Is a control's value number less than or equal to the specified maximum?
210210 */
211- public static function validateMax (Control $ control , $ maximum ): bool
211+ public static function validateMax (Control $ control , int | float | string | \ DateTimeInterface $ maximum ): bool
212212 {
213213 return Validators::isInRange ($ control ->getValue (), [null , $ maximum === '' ? null : $ maximum ]);
214214 }
@@ -232,7 +232,7 @@ public static function validateLength(Control $control, array|int $range): bool
232232 /**
233233 * Has control's value minimal count/length?
234234 */
235- public static function validateMinLength (Control $ control , $ length ): bool
235+ public static function validateMinLength (Control $ control , int $ length ): bool
236236 {
237237 return static ::validateLength ($ control , [$ length , null ]);
238238 }
@@ -241,7 +241,7 @@ public static function validateMinLength(Control $control, $length): bool
241241 /**
242242 * Is control's value count/length in limit?
243243 */
244- public static function validateMaxLength (Control $ control , $ length ): bool
244+ public static function validateMaxLength (Control $ control , int $ length ): bool
245245 {
246246 return static ::validateLength ($ control , [null , $ length ]);
247247 }
@@ -359,7 +359,7 @@ public static function validateFloat(Control $control): bool
359359 /**
360360 * Is file size in limit?
361361 */
362- public static function validateFileSize (Controls \UploadControl $ control , $ limit ): bool
362+ public static function validateFileSize (Controls \UploadControl $ control , int $ limit ): bool
363363 {
364364 foreach (static ::toArray ($ control ->getValue ()) as $ file ) {
365365 if ($ file ->getSize () > $ limit || $ file ->getError () === UPLOAD_ERR_INI_SIZE ) {
@@ -405,7 +405,7 @@ public static function validateImage(Controls\UploadControl $control): bool
405405
406406
407407 /** @return mixed[] */
408- private static function toArray ($ value ): array
408+ private static function toArray (mixed $ value ): array
409409 {
410410 return is_object ($ value ) ? [$ value ] : (array ) $ value ;
411411 }
0 commit comments