@@ -433,7 +433,7 @@ public function setAllowedValues($option, $allowedValues)
433
433
));
434
434
}
435
435
436
- $ this ->allowedValues [$ option ] = is_array ($ allowedValues ) ? $ allowedValues : array ($ allowedValues );
436
+ $ this ->allowedValues [$ option ] = \ is_array ($ allowedValues ) ? $ allowedValues : array ($ allowedValues );
437
437
438
438
// Make sure the option is processed
439
439
unset($ this ->resolved [$ option ]);
@@ -877,7 +877,7 @@ public function offsetGet($option)
877
877
*/
878
878
private function verifyTypes ($ type , $ value , array &$ invalidTypes )
879
879
{
880
- if ('[] ' === substr ($ type , -2 ) && is_array ( $ value )) {
880
+ if (\is_array ( $ value ) && '[] ' === substr ($ type , -2 )) {
881
881
if ($ this ->verifyArrayType ($ type , $ value , $ invalidTypes , $ type )) {
882
882
return true ;
883
883
}
@@ -905,10 +905,6 @@ private function verifyTypes($type, $value, array &$invalidTypes)
905
905
}
906
906
907
907
/**
908
- * @param $type
909
- * @param array $value
910
- * @param array $invalidTypes
911
- *
912
908
* @return bool
913
909
*/
914
910
private function verifyArrayType ($ type , array $ value , array &$ invalidTypes )
@@ -918,7 +914,7 @@ private function verifyArrayType($type, array $value, array &$invalidTypes)
918
914
if ('[] ' === substr ($ type , -2 )) {
919
915
$ success = true ;
920
916
foreach ($ value as $ item ) {
921
- if (!is_array ($ item )) {
917
+ if (!\ is_array ($ item )) {
922
918
$ invalidTypes [$ this ->formatTypeOf ($ item , null )] = true ;
923
919
924
920
return false ;
@@ -932,9 +928,7 @@ private function verifyArrayType($type, array $value, array &$invalidTypes)
932
928
return $ success ;
933
929
}
934
930
935
- $ invalid = $ this ->getInvalidValues ($ value , $ type );
936
-
937
- return !count ($ invalid );
931
+ return !$ this ->getInvalidValues ($ value , $ type );
938
932
}
939
933
940
934
/**
@@ -1020,13 +1014,13 @@ private function formatTypeOf($value, $type)
1020
1014
while ('[] ' === substr ($ type , -2 )) {
1021
1015
$ type = substr ($ type , 0 , -2 );
1022
1016
$ value = array_shift ($ value );
1023
- if (!is_array ($ value )) {
1017
+ if (!\ is_array ($ value )) {
1024
1018
break ;
1025
1019
}
1026
1020
$ suffix .= '[] ' ;
1027
1021
}
1028
1022
1029
- if (is_array ($ value )) {
1023
+ if (\ is_array ($ value )) {
1030
1024
$ subTypes = array ();
1031
1025
foreach ($ value as $ val ) {
1032
1026
$ subTypes [$ this ->formatTypeOf ($ val , null )] = true ;
@@ -1036,7 +1030,7 @@ private function formatTypeOf($value, $type)
1036
1030
}
1037
1031
}
1038
1032
1039
- return (is_object ($ value ) ? get_class ($ value ) : gettype ($ value )).$ suffix ;
1033
+ return (\ is_object ($ value ) ? get_class ($ value ) : gettype ($ value )).$ suffix ;
1040
1034
}
1041
1035
1042
1036
/**
@@ -1052,19 +1046,19 @@ private function formatTypeOf($value, $type)
1052
1046
*/
1053
1047
private function formatValue ($ value )
1054
1048
{
1055
- if (is_object ($ value )) {
1049
+ if (\ is_object ($ value )) {
1056
1050
return get_class ($ value );
1057
1051
}
1058
1052
1059
- if (is_array ($ value )) {
1053
+ if (\ is_array ($ value )) {
1060
1054
return 'array ' ;
1061
1055
}
1062
1056
1063
- if (is_string ($ value )) {
1057
+ if (\ is_string ($ value )) {
1064
1058
return '" ' .$ value .'" ' ;
1065
1059
}
1066
1060
1067
- if (is_resource ($ value )) {
1061
+ if (\ is_resource ($ value )) {
1068
1062
return 'resource ' ;
1069
1063
}
1070
1064
@@ -1110,8 +1104,6 @@ private static function isValueValidType($type, $value)
1110
1104
}
1111
1105
1112
1106
/**
1113
- * @param array $arrayValues
1114
- *
1115
1107
* @return array
1116
1108
*/
1117
1109
private function getInvalidValues (array $ arrayValues , $ type )
0 commit comments