Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
21 | 122 | public function __construct(string ...$properties) |
|
22 | { |
||
23 | 122 | $properties = Stream::of('string', ...$properties); |
|
24 | |||
25 | 122 | if ($properties->size() === 0) { |
|
26 | 119 | $properties = self::defaults(); |
|
27 | } |
||
28 | |||
29 | 122 | $properties->foreach(static function(string $property): void { |
|
30 | 122 | $refl = new \ReflectionClass($property); |
|
31 | |||
32 | 122 | if (!$refl->implementsInterface(Property::class)) { |
|
33 | 1 | throw new DomainException($property); |
|
34 | } |
||
35 | 122 | }); |
|
36 | |||
37 | 121 | $this->properties = $properties; |
|
38 | 121 | } |
|
69 |