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