@@ -311,19 +311,15 @@ public static function existsAll($need, $arr, $type = false)
311
311
self ::existsAll ($ v , $ arr , $ type );
312
312
}
313
313
314
+ } elseif (\strpos ($ need , ', ' ) !== false ) {
315
+ $ need = \explode (', ' , $ need );
316
+ self ::existsAll ($ need , $ arr , $ type );
314
317
} else {
318
+ $ arr = self ::valueToLower ($ arr );//小写
319
+ $ need = \strtolower (trim ($ need ));//小写
315
320
316
- #以逗号分隔的会被拆开,组成数组
317
- if (\strpos ($ need , ', ' ) !== false ) {
318
- $ need = \explode (', ' , $ need );
319
- self ::existsAll ($ need , $ arr , $ type );
320
- } else {
321
- $ arr = self ::valueToLower ($ arr );//小写
322
- $ need = \strtolower (trim ($ need ));//小写
323
-
324
- if (!\in_array ($ need , $ arr , $ type )) {
325
- return $ need ;
326
- }
321
+ if (!\in_array ($ need , $ arr , $ type )) {
322
+ return $ need ;
327
323
}
328
324
}
329
325
@@ -898,17 +894,13 @@ public static function toString(
898
894
if (\is_array ($ value )) {
899
895
$ string .= $ keyStr . 'Array( ' . self ::toString ($ value , $ length , $ cycles , $ showKey , $ addMark , $ separator ,
900
896
$ string ) . ') ' . $ separator ;
897
+ } elseif (\is_object ($ value )) {
898
+ $ string .= $ keyStr . 'Object( ' . \get_class ($ value ) . ') ' . $ separator ;
899
+ } elseif (\is_resource ($ value )) {
900
+ $ string .= $ keyStr . 'Resource( ' . get_resource_type ($ value ) . ') ' . $ separator ;
901
901
} else {
902
- if (\is_object ($ value )) {
903
- $ string .= $ keyStr . 'Object( ' . \get_class ($ value ) . ') ' . $ separator ;
904
- } else {
905
- if (\is_resource ($ value )) {
906
- $ string .= $ keyStr . 'Resource( ' . get_resource_type ($ value ) . ') ' . $ separator ;
907
- } else {
908
- $ value = \strlen ($ value ) > 150 ? substr ($ value , 0 , 150 ) : $ value ;
909
- $ string .= $ mark . $ keyStr . trim (htmlspecialchars ($ value )) . $ mark . $ separator ;
910
- }
911
- }
902
+ $ value = \strlen ($ value ) > 150 ? substr ($ value , 0 , 150 ) : $ value ;
903
+ $ string .= $ mark . $ keyStr . trim (htmlspecialchars ($ value )) . $ mark . $ separator ;
912
904
}
913
905
}
914
906
@@ -963,12 +955,10 @@ public static function toLimitOut($array): array
963
955
964
956
if (\is_array ($ value ) || \is_object ($ value )) {
965
957
$ value = \gettype ($ value ) . '(...) ' ;
958
+ } elseif (\is_string ($ value ) || is_numeric ($ value )) {
959
+ $ value = \strlen (trim ($ value ));
966
960
} else {
967
- if (\is_string ($ value ) || is_numeric ($ value )) {
968
- $ value = \strlen (trim ($ value ));
969
- } else {
970
- $ value = \gettype ($ value ) . "( $ value) " ;
971
- }
961
+ $ value = \gettype ($ value ) . "( $ value) " ;
972
962
}
973
963
974
964
$ array [$ key ] = $ value ;
0 commit comments