Total Complexity | 8 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class DummyAggregate implements AggregateRoot |
||
12 | { |
||
13 | use AggregateRootBehaviour; |
||
14 | |||
15 | private int $incrementedNumber = 0; |
||
16 | |||
17 | public static function create(DummyAggregateRootId $aggregateRootId): DummyAggregate |
||
18 | { |
||
19 | $aggregate = new static($aggregateRootId); |
||
20 | $aggregate->recordThat(new AggregateWasInitiated()); |
||
21 | |||
22 | return $aggregate; |
||
23 | } |
||
24 | |||
25 | protected function applyAggregateWasInitiated(): void |
||
26 | { |
||
27 | // cool |
||
28 | } |
||
29 | |||
30 | public function performDummyTask(): void |
||
31 | { |
||
32 | $this->recordThat(new DummyTaskWasExecuted()); |
||
33 | } |
||
34 | |||
35 | public function increment(): void |
||
36 | { |
||
37 | $this->recordThat( |
||
38 | new DummyIncrementingHappened( |
||
39 | $this->incrementedNumber + 1 |
||
40 | ) |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | protected function applyDummyIncrementingHappened(DummyIncrementingHappened $event): void |
||
47 | } |
||
48 | |||
49 | protected function applyDummyTaskWasExecuted(/* @scrutinizer ignore-unused */ DummyTaskWasExecuted $event): void |
||
50 | { |
||
51 | } |
||
52 | |||
53 | public function dontDoAnything(): void |
||
55 | // not doing anything. |
||
56 | } |
||
57 | |||
58 | public function throwAnException(): void |
||
61 | } |
||
62 | } |
||
63 |