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