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