| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class DomainEventEmitter |
||
| 10 | { |
||
| 11 | private static ?self $instance = null; |
||
| 12 | private EventCollection $events; |
||
| 13 | |||
| 14 | private function __construct() |
||
| 17 | } |
||
| 18 | |||
| 19 | private function resetEvents(): void |
||
| 20 | { |
||
| 21 | /** @var EventCollection events */ |
||
| 22 | $this->events = EventCollection::createEmptyCollection(); |
||
| 23 | } |
||
| 24 | |||
| 25 | public static function recordThat(AggregateChanged $event): void |
||
| 26 | { |
||
| 27 | $self = self::assertInstance(); |
||
| 28 | $self->events->addItem($event); |
||
| 29 | } |
||
| 30 | |||
| 31 | public static function emit(): Generator |
||
| 38 | } |
||
| 39 | |||
| 40 | private static function assertInstance(): self |
||
| 47 | } |
||
| 48 | } |
||
| 49 |