| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait EventRecordingCapabilities |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var object[] |
||
| 14 | */ |
||
| 15 | private $events = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Use this method inside your aggregate to record new domain events. |
||
| 19 | */ |
||
| 20 | 26 | protected function recordThat(object $event): void |
|
| 21 | { |
||
| 22 | 26 | $this->events[] = $event; |
|
| 23 | 26 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @see \TalisOrm\Aggregate::releaseEvents() |
||
| 27 | * @return object[] |
||
| 28 | */ |
||
| 29 | 25 | public function releaseEvents(): array |
|
| 36 | } |
||
| 37 | } |
||
| 38 |