Skip to content

Commit 854bab9

Browse files
authored
Merge pull request #83 from php-api-clients/rename-OptimizedHydratorMapper-to-Hydrator
Rename OptimizedHydratorMapper to Hydrator
2 parents 50fbdcd + cb53a88 commit 854bab9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Generator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ private function all(string $namespace, string $rootPath): iterable
201201
}
202202

203203
yield new File(
204-
$namespace . 'OptimizedHydratorMapper',
204+
$namespace . 'Hydrator',
205205
(new ObjectMapperCodeGenerator())->dump(
206206
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)),
207-
$namespace . 'OptimizedHydratorMapper'
207+
$namespace . 'Hydrator'
208208
)
209209
);
210210
}

src/Generator/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function generate(string $namespace, array $clients, SchemaRegistr
4949
)->addStmt(
5050
$factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate()
5151
)->addStmt(
52-
$factory->property('hydrator')->setType('\\' . $namespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate()
52+
$factory->property('hydrator')->setType('\\' . $namespace . 'Hydrator')->makeReadonly()->makePrivate()
5353
)->addStmt(
5454
$factory->method('__construct')->makePublic()->addParam(
5555
(new Param('authentication'))->setType('\\' . AuthenticationInterface::class)
@@ -113,7 +113,7 @@ public static function generate(string $namespace, array $clients, SchemaRegistr
113113
'hydrator'
114114
),
115115
new Node\Expr\New_(
116-
new Node\Name('\\' . $namespace . 'OptimizedHydratorMapper'),
116+
new Node\Name('\\' . $namespace . 'Hydrator'),
117117
[
118118
]
119119
),

src/Generator/Clients.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function generate(string $operationGroup, string $namespace, strin
2727
)->addStmt(
2828
$factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate()
2929
)->addStmt(
30-
$factory->property('hydrator')->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate()
30+
$factory->property('hydrator')->setType('\\' . $rootNamespace . 'Hydrator')->makeReadonly()->makePrivate()
3131
)->addStmt(
3232
$factory->method('__construct')->makePublic()->addParam(
3333
(new Param('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')
@@ -50,7 +50,7 @@ public static function generate(string $operationGroup, string $namespace, strin
5050
new Node\Expr\Variable('responseSchemaValidator'),
5151
)
5252
)->addParam(
53-
(new Param('hydrator'))->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')
53+
(new Param('hydrator'))->setType('\\' . $rootNamespace . 'Hydrator')
5454
)->addStmt(
5555
new Node\Expr\Assign(
5656
new Node\Expr\PropertyFetch(

src/Generator/Operation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function generate(string $path, string $method, string $namespace,
7373
)->addStmt(
7474
$factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate()
7575
)->addStmt(
76-
$factory->property('hydrator')->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')->makeReadonly()->makePrivate()
76+
$factory->property('hydrator')->setType('\\' . $rootNamespace . 'Hydrator')->makeReadonly()->makePrivate()
7777
);
7878

7979
$constructor = $factory->method('__construct')->makePublic()->addParam(
@@ -97,7 +97,7 @@ public static function generate(string $path, string $method, string $namespace,
9797
new Node\Expr\Variable('responseSchemaValidator'),
9898
)
9999
)->addParam(
100-
(new Param('hydrator'))->setType('\\' . $rootNamespace . 'OptimizedHydratorMapper')
100+
(new Param('hydrator'))->setType('\\' . $rootNamespace . 'Hydrator')
101101
)->addStmt(
102102
new Node\Expr\Assign(
103103
new Node\Expr\PropertyFetch(

0 commit comments

Comments
 (0)