Completed
Push — master ( 4803b3...959101 )
by Frank
03:46
created

DummyAggregate::applyDummyTaskWasExecuted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace EventSauce\EventSourcing\Integration\TestingAggregates;
4
5
use EventSauce\EventSourcing\AggregateRoot;
6
use EventSauce\EventSourcing\Time\Clock;
7
8
class DummyAggregate extends AggregateRoot
9
{
10
    private $incrementedNumber = 0;
11
12 1
    public function performDummyTask(Clock $clock)
13
    {
14 1
        $this->recordThat(new DummyTaskWasExecuted(
15 1
            $this->aggregateRootId(),
16 1
            $clock->pointInTime()
17
        ));
18 1
    }
19
20 1
    public function increment(Clock $clock)
21
    {
22 1
        $this->recordThat(new DummyIncrementingHappened(
23 1
            $this->aggregateRootId(),
24 1
            $clock->pointInTime(),
25 1
            $this->incrementedNumber + 1
26
        ));
27 1
    }
28
29 1
    protected function applyDummyIncrementingHappened(DummyIncrementingHappened $event)
30
    {
31 1
        $this->incrementedNumber = $event->number();
32 1
    }
33
34 1
    protected function applyDummyTaskWasExecuted(DummyTaskWasExecuted $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36
37 1
    }
38
39 1
    public function dontDoAnything()
40
    {
41
        // not doing anything.
42 1
    }
43
44 3
    public function throwAnException()
45
    {
46 3
        throw new DummyException();
47
    }
48
}