@@ -163,8 +163,10 @@ public static function boolean($val): bool
163
163
}
164
164
165
165
/**
166
+ * @param mixed $val
167
+ *
168
+ * @return bool
166
169
* @see Validators::boolean()
167
- * {@inheritdoc}
168
170
*/
169
171
public static function bool ($ val ): bool
170
172
{
@@ -271,8 +273,13 @@ public static function integer($val, $min = null, $max = null, $flags = 0): bool
271
273
}
272
274
273
275
/**
276
+ * @param int|mixed $val
277
+ * @param int|null $min
278
+ * @param int|null $max
279
+ * @param int $flags
280
+ *
281
+ * @return bool
274
282
* @see integer()
275
- * {@inheritdoc}
276
283
*/
277
284
public static function int ($ val , $ min = null , $ max = null , $ flags = 0 ): bool
278
285
{
@@ -303,8 +310,13 @@ public static function number($val, $min = null, $max = null, $flags = 0): bool
303
310
}
304
311
305
312
/**
313
+ * @param int|mixed $val
314
+ * @param int|null $min
315
+ * @param int|null $max
316
+ * @param int $flags
317
+ *
318
+ * @return bool
306
319
* @see number()
307
- * {@inheritdoc}
308
320
*/
309
321
public static function num ($ val , $ min = null , $ max = null , $ flags = 0 ): bool
310
322
{
@@ -549,17 +561,25 @@ public static function size($val, $min = null, $max = null): bool
549
561
}
550
562
551
563
/**
564
+ * @param int|string|array|mixed $val
565
+ * @param int|null $min
566
+ * @param int|null $max
567
+ *
568
+ * @return bool
552
569
* @see Validators::size()
553
- * {@inheritdoc}
554
570
*/
555
571
public static function between ($ val , $ min = null , $ max = null ): bool
556
572
{
557
573
return self ::size ($ val , $ min , $ max );
558
574
}
559
575
560
576
/**
577
+ * @param int|string|array|mixed $val
578
+ * @param int|null $min
579
+ * @param int|null $max
580
+ *
581
+ * @return bool
561
582
* @see Validators::size()
562
- * {@inheritdoc}
563
583
*/
564
584
public static function range ($ val , $ min = null , $ max = null ): bool
565
585
{
@@ -842,8 +862,7 @@ public static function json($val, $strict = true): bool
842
862
return false ;
843
863
}
844
864
845
- json_decode ($ val );
846
-
865
+ json_decode ($ val , true );
847
866
return json_last_error () === JSON_ERROR_NONE ;
848
867
}
849
868
@@ -997,7 +1016,7 @@ public static function strList($val): bool
997
1016
/**
998
1017
* 验证字段值是否是一个 array list, 多维数组
999
1018
*
1000
- * @param $val
1019
+ * @param array|mixed $val
1001
1020
*
1002
1021
* @return bool
1003
1022
*/
@@ -1007,7 +1026,6 @@ public static function arrList($val): bool
1007
1026
return false ;
1008
1027
}
1009
1028
1010
- /** @var array $val */
1011
1029
foreach ($ val as $ k => $ v ) {
1012
1030
if (!is_array ($ v )) {
1013
1031
return false ;
0 commit comments