Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 2 | public static function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): AggregateRoot |
|
16 | { |
||
17 | 2 | $aggregateRoot = static::defaultAggregateRootReconstitute($aggregateRootId, $events); |
|
18 | |||
19 | 2 | if (0 === $aggregateRoot->aggregateRootVersion()) { |
|
20 | 1 | throw new InvalidAggregateRootReconstitutionException(); |
|
21 | } |
||
22 | |||
23 | 1 | return $aggregateRoot; |
|
24 | } |
||
26 |