| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 6 | public static function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): AggregateRoot |
|
| 62 | { |
||
| 63 | 6 | $aggregateRoot = new static($aggregateRootId); |
|
| 64 | |||
| 65 | /** @var Event $event */ |
||
| 66 | 6 | foreach ($events as $event) { |
|
| 67 | 1 | $aggregateRoot->apply($event); |
|
| 68 | } |
||
| 69 | |||
| 70 | 6 | return $aggregateRoot; |
|
| 71 | } |
||
| 72 | } |