@@ -118,9 +118,9 @@ private static function fillUpSchema(string $name, string $namespace, string $cl
118118
119119 if ($ property ->type === 'array ' && $ property ->items instanceof OpenAPiSchema) {
120120// if (array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) {
121- $ methodDocBlock [] = '@return array< \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items ) . '> ' ;
122- $ propertyDocBlock [] = '@var array< \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items ) . '> ' ;
123- $ propertyDocBlock [] = '@\WyriHaximus\Hydrator\Attribute\HydrateArray( \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items ) . '::class) ' ;
121+ $ methodDocBlock [] = '@return array< \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items , $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () ) . '> ' ;
122+ $ propertyDocBlock [] = '@var array< \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items , $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () ) . '> ' ;
123+ $ propertyDocBlock [] = '@\WyriHaximus\Hydrator\Attribute\HydrateArray( \\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->items , $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () ) . '::class) ' ;
124124// } elseif ($property->items->type === 'object') {
125125// yield from self::generate($name . '::' . $propertyName, $namespace . '\\' . $className, (new Convert($propertyName))->toPascal(), $property->items, $schemaClassNameMap, $rootNamespace);
126126// $methodDocBlock[] = '@return array<\\' . $namespace . '\\' . $className . '\\' . (new Convert($propertyName))->toPascal() . '>';
@@ -155,21 +155,21 @@ private static function fillUpSchema(string $name, string $namespace, string $cl
155155 }
156156
157157 if (is_array ($ property ->anyOf ) && $ property ->anyOf [0 ] instanceof OpenAPiSchema/* && array_key_exists(spl_object_hash($property->anyOf[0]), $schemaClassNameMap)*/ ) {
158- $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->anyOf [0 ]);
158+ $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->anyOf [0 ], $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () );
159159 $ propertyStmt ->setType ($ nullable . $ fqcnn );
160160 $ method ->setReturnType ($ nullable . $ fqcnn );
161161 $ propertyDocBlock [] = '@\WyriHaximus\Hydrator\Attribute\Hydrate( ' . $ fqcnn . '::class) ' ;
162162 $ setDefaylt = false ;
163163 } else if (is_array ($ property ->allOf ) && $ property ->allOf [0 ] instanceof OpenAPiSchema/* && array_key_exists(spl_object_hash($property->allOf[0]), $schemaClassNameMap)*/ ) {
164- $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->allOf [0 ]);
164+ $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property ->allOf [0 ], $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () );
165165 $ propertyStmt ->setType ($ nullable . $ fqcnn );
166166 $ method ->setReturnType ($ nullable . $ fqcnn );
167167 $ propertyDocBlock [] = '@\WyriHaximus\Hydrator\Attribute\Hydrate( ' . $ fqcnn . '::class) ' ;
168168 $ setDefaylt = false ;
169169 }
170170
171171 if ($ property ->type === 'object ' && $ property instanceof OpenAPiSchema/* && array_key_exists(spl_object_hash($property), $schemaClassNameMap)*/ ) {
172- $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property );
172+ $ fqcnn = '\\' . $ rootNamespace . '\\' . $ schemaRegistry ->get ($ property, $ className . '\\' . ( new Convert ( $ propertyName ))-> toPascal () );
173173 $ propertyStmt ->setType ($ nullable . $ fqcnn );
174174 $ method ->setReturnType ($ nullable . $ fqcnn );
175175 $ propertyDocBlock [] = '@\WyriHaximus\Hydrator\Attribute\Hydrate( ' . $ fqcnn . '::class) ' ;
0 commit comments