| Total Complexity | 7 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | abstract class AggregateRoot |
||
| 12 | { |
||
| 13 | public const EVENT_MAP = []; |
||
| 14 | protected array $events; |
||
| 15 | protected string $aggregateId; |
||
| 16 | |||
| 17 | final public function __construct() |
||
| 18 | { |
||
| 19 | $this->events = []; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function aggregateId(): string |
||
| 23 | { |
||
| 24 | return $this->aggregateId; |
||
| 25 | } |
||
| 26 | |||
| 27 | protected function recordThat(AggregateChanged $occur): void |
||
| 28 | { |
||
| 29 | $this->events[] = $occur; |
||
| 30 | DomainEventEmitter::recordThat($occur); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function popEvents(): EventCollection |
||
| 47 | } |
||
| 48 | |||
| 49 | public function apply(AggregateChanged $aggregateChanged): void |
||
| 50 | { |
||
| 60 |