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