Total Complexity | 3 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
16 | 6 | final class ConstraintBuilder extends AbstractBuilder |
|
17 | { |
||
18 | public function __construct(SchemaInterface $schema) |
||
19 | { |
||
20 | $entity = $this->getInflector()->entity($schema->name()); |
||
21 | $rules = \array_reduce( |
||
22 | $schema->attributes(), |
||
23 | function (array $result, SchemaAttributeInterface $schemaAttribute) { |
||
24 | $result[$schemaAttribute->name()] = (new RuleBuilder($schemaAttribute))->build(); |
||
25 | |||
26 | return $result; |
||
27 | }, |
||
28 | [] |
||
29 | ); |
||
30 | |||
31 | parent::__construct(\compact('entity', 'rules')); |
||
32 | } |
||
33 | |||
34 | protected function getFileTemplate(): string |
||
37 | } |
||
38 | |||
39 | protected function getPathTemplate(): string |
||
42 | } |
||
43 | } |
||
44 |