Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
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 | } |
||
44 |