-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDefinitionsGenerator.php
More file actions
33 lines (27 loc) · 868 Bytes
/
Copy pathDefinitionsGenerator.php
File metadata and controls
33 lines (27 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
namespace Helmich\Schema2Class\Generator\Definitions;
use Helmich\Schema2Class\Generator\GeneratorRequest;
use Helmich\Schema2Class\Generator\SchemaToClass;
class DefinitionsGenerator
{
public function __construct(
private SchemaToClass $schemaToClass,
)
{
}
/**
* @param array<string, Definition> $definitions
*/
public function generate(array $definitions, GeneratorRequest $generatorRequest): void
{
foreach ($definitions as $definition) {
$newRequest = $generatorRequest->withClass($definition->className)
->withSchema($definition->schema)
->withNamespace($definition->namespace)
->withDirectory($definition->directory)
;
$this->schemaToClass->schemaToClass($newRequest);
}
}
}