@@ -18,31 +18,31 @@ trait InteractsWithTypes
1818 /**
1919 * Resolve the schema instance from the given reflection type.
2020 */
21- protected static function getSchemaFromReflectionType (
21+ protected function getSchemaFromReflectionType (
2222 ReflectionNamedType |ReflectionUnionType |ReflectionIntersectionType |null $ type ,
2323 ): Schema {
2424 $ schemaTypes = match (true ) {
2525 $ type instanceof ReflectionUnionType, $ type instanceof ReflectionIntersectionType => array_map (
2626 // @phpstan-ignore argument.type
27- fn (ReflectionNamedType $ reflectionNamedType ): SchemaType => self :: resolveSchemaType (
27+ fn (ReflectionNamedType $ reflectionNamedType ): SchemaType => $ this -> resolveSchemaType (
2828 $ reflectionNamedType ,
2929 ),
3030 $ type ->getTypes (),
3131 ),
3232 // If the parameter is not typed or explicitly typed as mixed, we use all schema types
3333 in_array ($ type ?->getName(), ['mixed ' , null ], true ) => SchemaType::cases (),
34- default => [self :: resolveSchemaType ($ type )],
34+ default => [$ this -> resolveSchemaType ($ type )],
3535 };
3636
3737 return count ($ schemaTypes ) === 1
38- ? $ schemaTypes [0 ]->instance ()
39- : new UnionSchema (array_values ($ schemaTypes ));
38+ ? $ schemaTypes [0 ]->instance (null , $ this -> version )
39+ : new UnionSchema (array_values ($ schemaTypes ), null , $ this -> version );
4040 }
4141
4242 /**
4343 * Resolve the schema type from the given reflection type.
4444 */
45- protected static function resolveSchemaType (ReflectionNamedType $ reflectionNamedType ): SchemaType
45+ protected function resolveSchemaType (ReflectionNamedType $ reflectionNamedType ): SchemaType
4646 {
4747 $ typeName = $ reflectionNamedType ->getName ();
4848
0 commit comments