| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | public static function reconstituteFrom(EntityHistory $history): EventSourcedEntity |
||
| 14 | { |
||
| 15 | /** @var AggregateRoot $aggregate */ |
||
| 16 | $aggregate = new static($history->getId()); |
||
| 17 | foreach ($history as $event) { |
||
| 18 | $aggregate->apply($event); |
||
| 19 | } |
||
| 20 | return $aggregate; |
||
| 21 | } |
||
| 23 |