diff --git a/src/Generator.php b/src/Generator.php index 336f012..0406ccc 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -201,10 +201,10 @@ private function all(string $namespace, string $rootPath): iterable } yield new File( - $namespace . 'OptimizedHydratorMapper', + $namespace . 'Hydrator', (new ObjectMapperCodeGenerator())->dump( array_unique(array_filter(array_map(static fn (string $className): string => str_replace('/', '\\', $className), $schemaClasses), static fn (string $className): bool => count((new \ReflectionMethod($className, '__construct'))->getParameters()) > 0)), - $namespace . 'OptimizedHydratorMapper' + $namespace . 'Hydrator' ) ); } diff --git a/src/Generator/Client.php b/src/Generator/Client.php index 885747c..358bdf5 100644 --- a/src/Generator/Client.php +++ b/src/Generator/Client.php @@ -49,7 +49,7 @@ public static function generate(string $namespace, array $clients, SchemaRegistr )->addStmt( $factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate() )->addStmt( - $factory->property('hydrator')->setType('\\' . $namespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate() + $factory->property('hydrator')->setType('\\' . $namespace . 'Hydrator')->makeReadonly()->makePrivate() )->addStmt( $factory->method('__construct')->makePublic()->addParam( (new Param('authentication'))->setType('\\' . AuthenticationInterface::class) @@ -113,7 +113,7 @@ public static function generate(string $namespace, array $clients, SchemaRegistr 'hydrator' ), new Node\Expr\New_( - new Node\Name('\\' . $namespace . 'OptimizedHydratorMapper'), + new Node\Name('\\' . $namespace . 'Hydrator'), [ ] ), diff --git a/src/Generator/Clients.php b/src/Generator/Clients.php index a0d225b..e54268b 100644 --- a/src/Generator/Clients.php +++ b/src/Generator/Clients.php @@ -27,7 +27,7 @@ public static function generate(string $operationGroup, string $namespace, strin )->addStmt( $factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate() )->addStmt( - $factory->property('hydrator')->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate() + $factory->property('hydrator')->setType('\\' . $rootNamespace . 'Hydrator')->makeReadonly()->makePrivate() )->addStmt( $factory->method('__construct')->makePublic()->addParam( (new Param('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator') @@ -50,7 +50,7 @@ public static function generate(string $operationGroup, string $namespace, strin new Node\Expr\Variable('responseSchemaValidator'), ) )->addParam( - (new Param('hydrator'))->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper') + (new Param('hydrator'))->setType('\\' . $rootNamespace . 'Hydrator') )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( diff --git a/src/Generator/Operation.php b/src/Generator/Operation.php index 276325a..cd5c922 100644 --- a/src/Generator/Operation.php +++ b/src/Generator/Operation.php @@ -73,7 +73,7 @@ public static function generate(string $path, string $method, string $namespace, )->addStmt( $factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate() )->addStmt( - $factory->property('hydrator')->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate() + $factory->property('hydrator')->setType('\\' . $rootNamespace . 'Hydrator')->makeReadonly()->makePrivate() ); $constructor = $factory->method('__construct')->makePublic()->addParam( @@ -97,7 +97,7 @@ public static function generate(string $path, string $method, string $namespace, new Node\Expr\Variable('responseSchemaValidator'), ) )->addParam( - (new Param('hydrator'))->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper') + (new Param('hydrator'))->setType('\\' . $rootNamespace . 'Hydrator') )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch(