Total Complexity | 3 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class DelegatedBehaviorInAggregate implements EventSourcedAggregate |
||
12 | { |
||
13 | use AggregateAppliesKnownEvents; |
||
14 | |||
15 | private int $counter = 0; |
||
16 | |||
17 | public function __construct(private EventRecorder $eventRecorder) |
||
19 | } |
||
20 | |||
21 | public function performAction(): void |
||
22 | { |
||
23 | $this->eventRecorder->recordThat(new DelegatedActionWasPerformed($this->counter + 1)); |
||
24 | } |
||
25 | |||
26 | protected function applyDelegatedActionWasPerformed(DelegatedActionWasPerformed $event): void |
||
29 | } |
||
30 | } |
||
31 |