Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 6 | public function __construct(string $id, Segments $segments) |
|
20 | { |
||
21 | 6 | foreach ($segments->all() as $segment) { |
|
22 | 4 | if (false === $segment instanceof IdentitySegment) { |
|
23 | 1 | throw new InvalidArgumentException(sprintf( |
|
24 | 1 | 'Enable by matching identity id segment must be instance of %s class.', |
|
25 | 1 | IdentitySegment::class |
|
26 | )); |
||
27 | } |
||
28 | } |
||
29 | 5 | $this->id = $id; |
|
30 | 5 | $this->segments = $segments; |
|
31 | 5 | } |
|
74 |