@@ -35,7 +35,7 @@ public static function fromReflection(
35
35
? $ reflection ->getReturnType () ?? (PHP_VERSION_ID >= 80100 && $ reflection instanceof \ReflectionMethod ? $ reflection ->getTentativeReturnType () : null )
36
36
: $ reflection ->getType ();
37
37
38
- return $ type ? self ::fromReflectionType ($ type , $ reflection , true ) : null ;
38
+ return $ type ? self ::fromReflectionType ($ type , $ reflection , asObject: true ) : null ;
39
39
}
40
40
41
41
@@ -49,7 +49,7 @@ private static function fromReflectionType(\ReflectionType $type, $of, bool $asO
49
49
50
50
} elseif ($ type instanceof \ReflectionUnionType || $ type instanceof \ReflectionIntersectionType) {
51
51
return new self (
52
- array_map (fn ($ t ) => self ::fromReflectionType ($ t , $ of , false ), $ type ->getTypes ()),
52
+ array_map (fn ($ t ) => self ::fromReflectionType ($ t , $ of , asObject: false ), $ type ->getTypes ()),
53
53
$ type instanceof \ReflectionUnionType ? '| ' : '& ' ,
54
54
);
55
55
@@ -109,7 +109,7 @@ public static function resolve(
109
109
110
110
private function __construct (array $ types , string $ kind = '| ' )
111
111
{
112
- $ o = array_search ('null ' , $ types , true );
112
+ $ o = array_search ('null ' , $ types , strict: true );
113
113
if ($ o !== false ) { // null as last
114
114
array_splice ($ types , $ o , 1 );
115
115
$ types [] = 'null ' ;
@@ -260,7 +260,7 @@ private function allows3(array $types, array $subtypes): bool
260
260
$ subtypes ,
261
261
fn ($ subtype ) => Validators::isBuiltinType ($ type )
262
262
? strcasecmp ($ type , $ subtype ) === 0
263
- : is_a ($ subtype , $ type , true )
263
+ : is_a ($ subtype , $ type , allow_string: true )
264
264
)
265
265
);
266
266
}
0 commit comments