@@ -35,7 +35,7 @@ public static function fromReflection(
3535 ? $ reflection ->getReturnType () ?? (PHP_VERSION_ID >= 80100 && $ reflection instanceof \ReflectionMethod ? $ reflection ->getTentativeReturnType () : null )
3636 : $ reflection ->getType ();
3737
38- return $ type ? self ::fromReflectionType ($ type , $ reflection , true ) : null ;
38+ return $ type ? self ::fromReflectionType ($ type , $ reflection , asObject: true ) : null ;
3939 }
4040
4141
@@ -49,7 +49,7 @@ private static function fromReflectionType(\ReflectionType $type, $of, bool $asO
4949
5050 } elseif ($ type instanceof \ReflectionUnionType || $ type instanceof \ReflectionIntersectionType) {
5151 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 ()),
5353 $ type instanceof \ReflectionUnionType ? '| ' : '& ' ,
5454 );
5555
@@ -109,7 +109,7 @@ public static function resolve(
109109
110110 private function __construct (array $ types , string $ kind = '| ' )
111111 {
112- $ o = array_search ('null ' , $ types , true );
112+ $ o = array_search ('null ' , $ types , strict: true );
113113 if ($ o !== false ) { // null as last
114114 array_splice ($ types , $ o , 1 );
115115 $ types [] = 'null ' ;
@@ -260,7 +260,7 @@ private function allows3(array $types, array $subtypes): bool
260260 $ subtypes ,
261261 fn ($ subtype ) => Validators::isBuiltinType ($ type )
262262 ? strcasecmp ($ type , $ subtype ) === 0
263- : is_a ($ subtype , $ type , true )
263+ : is_a ($ subtype , $ type , allow_string: true )
264264 )
265265 );
266266 }
0 commit comments