@@ -163,8 +163,10 @@ public static function boolean($val): bool
163163 }
164164
165165 /**
166+ * @param mixed $val
167+ *
168+ * @return bool
166169 * @see Validators::boolean()
167- * {@inheritdoc}
168170 */
169171 public static function bool ($ val ): bool
170172 {
@@ -271,8 +273,13 @@ public static function integer($val, $min = null, $max = null, $flags = 0): bool
271273 }
272274
273275 /**
276+ * @param int|mixed $val
277+ * @param int|null $min
278+ * @param int|null $max
279+ * @param int $flags
280+ *
281+ * @return bool
274282 * @see integer()
275- * {@inheritdoc}
276283 */
277284 public static function int ($ val , $ min = null , $ max = null , $ flags = 0 ): bool
278285 {
@@ -303,8 +310,13 @@ public static function number($val, $min = null, $max = null, $flags = 0): bool
303310 }
304311
305312 /**
313+ * @param int|mixed $val
314+ * @param int|null $min
315+ * @param int|null $max
316+ * @param int $flags
317+ *
318+ * @return bool
306319 * @see number()
307- * {@inheritdoc}
308320 */
309321 public static function num ($ val , $ min = null , $ max = null , $ flags = 0 ): bool
310322 {
@@ -549,17 +561,25 @@ public static function size($val, $min = null, $max = null): bool
549561 }
550562
551563 /**
564+ * @param int|string|array|mixed $val
565+ * @param int|null $min
566+ * @param int|null $max
567+ *
568+ * @return bool
552569 * @see Validators::size()
553- * {@inheritdoc}
554570 */
555571 public static function between ($ val , $ min = null , $ max = null ): bool
556572 {
557573 return self ::size ($ val , $ min , $ max );
558574 }
559575
560576 /**
577+ * @param int|string|array|mixed $val
578+ * @param int|null $min
579+ * @param int|null $max
580+ *
581+ * @return bool
561582 * @see Validators::size()
562- * {@inheritdoc}
563583 */
564584 public static function range ($ val , $ min = null , $ max = null ): bool
565585 {
@@ -842,8 +862,7 @@ public static function json($val, $strict = true): bool
842862 return false ;
843863 }
844864
845- json_decode ($ val );
846-
865+ json_decode ($ val , true );
847866 return json_last_error () === JSON_ERROR_NONE ;
848867 }
849868
@@ -997,7 +1016,7 @@ public static function strList($val): bool
9971016 /**
9981017 * 验证字段值是否是一个 array list, 多维数组
9991018 *
1000- * @param $val
1019+ * @param array|mixed $val
10011020 *
10021021 * @return bool
10031022 */
@@ -1007,7 +1026,6 @@ public static function arrList($val): bool
10071026 return false ;
10081027 }
10091028
1010- /** @var array $val */
10111029 foreach ($ val as $ k => $ v ) {
10121030 if (!is_array ($ v )) {
10131031 return false ;
0 commit comments