Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
16 | 13 | public function __construct(iterable $attributes = []) |
|
17 | { |
||
18 | 13 | $mappedAttributes = []; |
|
19 | /** @var AttributeInterface $attribute */ |
||
20 | 13 | foreach ($attributes as $attribute) { |
|
21 | 12 | $name = $attribute->getName(); |
|
22 | 12 | Assertion::keyNotExists($mappedAttributes, $name, "Attribute name '$name' is already defined."); |
|
23 | 12 | $mappedAttributes[$name] = $attribute; |
|
24 | } |
||
25 | |||
26 | 12 | $this->init($mappedAttributes, [AttributeInterface::class]); |
|
27 | 12 | } |
|
29 |