@@ -115,7 +115,7 @@ public static function formatMessage(Rule $rule, bool $withValue = true): string
115115 /**
116116 * Is control's value equal with second parameter?
117117 */
118- public static function validateEqual (Control $ control , $ arg ): bool
118+ public static function validateEqual (Control $ control , mixed $ arg ): bool
119119 {
120120 $ value = $ control ->getValue ();
121121 $ values = is_array ($ value ) ? $ value : [$ value ];
@@ -142,7 +142,7 @@ public static function validateEqual(Control $control, $arg): bool
142142 /**
143143 * Is control's value not equal with second parameter?
144144 */
145- public static function validateNotEqual (Control $ control , $ arg ): bool
145+ public static function validateNotEqual (Control $ control , mixed $ arg ): bool
146146 {
147147 return !static ::validateEqual ($ control , $ arg );
148148 }
@@ -201,7 +201,7 @@ public static function validateRange(Control $control, array $range): bool
201201 /**
202202 * Is a control's value number greater than or equal to the specified minimum?
203203 */
204- public static function validateMin (Control $ control , $ minimum ): bool
204+ public static function validateMin (Control $ control , int | float | string | \ DateTimeInterface $ minimum ): bool
205205 {
206206 return Validators::isInRange ($ control ->getValue (), [$ minimum === '' ? null : $ minimum , null ]);
207207 }
@@ -210,7 +210,7 @@ public static function validateMin(Control $control, $minimum): bool
210210 /**
211211 * Is a control's value number less than or equal to the specified maximum?
212212 */
213- public static function validateMax (Control $ control , $ maximum ): bool
213+ public static function validateMax (Control $ control , int | float | string | \ DateTimeInterface $ maximum ): bool
214214 {
215215 return Validators::isInRange ($ control ->getValue (), [null , $ maximum === '' ? null : $ maximum ]);
216216 }
@@ -234,7 +234,7 @@ public static function validateLength(Control $control, array|int $range): bool
234234 /**
235235 * Has control's value minimal count/length?
236236 */
237- public static function validateMinLength (Control $ control , $ length ): bool
237+ public static function validateMinLength (Control $ control , int $ length ): bool
238238 {
239239 return static ::validateLength ($ control , [$ length , null ]);
240240 }
@@ -243,7 +243,7 @@ public static function validateMinLength(Control $control, $length): bool
243243 /**
244244 * Is control's value count/length in limit?
245245 */
246- public static function validateMaxLength (Control $ control , $ length ): bool
246+ public static function validateMaxLength (Control $ control , int $ length ): bool
247247 {
248248 return static ::validateLength ($ control , [null , $ length ]);
249249 }
@@ -361,7 +361,7 @@ public static function validateFloat(Control $control): bool
361361 /**
362362 * Is file size in limit?
363363 */
364- public static function validateFileSize (Controls \UploadControl $ control , $ limit ): bool
364+ public static function validateFileSize (Controls \UploadControl $ control , int $ limit ): bool
365365 {
366366 foreach (static ::toArray ($ control ->getValue ()) as $ file ) {
367367 if ($ file ->getSize () > $ limit || $ file ->getError () === UPLOAD_ERR_INI_SIZE ) {
@@ -407,7 +407,7 @@ public static function validateImage(Controls\UploadControl $control): bool
407407
408408
409409 /** @return mixed[] */
410- private static function toArray ($ value ): array
410+ private static function toArray (mixed $ value ): array
411411 {
412412 return is_object ($ value ) ? [$ value ] : (array ) $ value ;
413413 }
0 commit comments