Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
20 | public function execute(CreateFactoryFileRequest $request): CreateFactoryFileResponse |
||
21 | { |
||
22 | $inflector = new Inflector(); |
||
23 | $entity = $inflector->entity($request->schema->name()); |
||
24 | |||
25 | $factory = new FactoryBuilder($request->schema); |
||
26 | $filename = $entity . 'Factory'; |
||
27 | $path = \sprintf('%1$s/../../tmp/skeleton/domain/%2$s', __DIR__, $entity); |
||
28 | $writer = new PhpWriter($factory->build(), $filename, $path); |
||
29 | |||
30 | return new CreateFactoryFileResponse($writer->save()); |
||
31 | } |
||
33 |