| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 7 | public static function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): AggregateRoot |
|
| 35 | { |
||
| 36 | 7 | $aggregateRoot = new static($aggregateRootId); |
|
| 37 | |||
| 38 | /** @var Event $event */ |
||
| 39 | 7 | foreach ($events as $event) { |
|
| 40 | 1 | $aggregateRoot->apply($event); |
|
| 41 | } |
||
| 42 | |||
| 43 | 7 | return $aggregateRoot; |
|
| 44 | } |
||
| 45 | |||
| 47 | } |