Passed
Pull Request — master (#54)
by Frank
02:29
created

DummyAggregate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

37
    protected function applyDummyTaskWasExecuted(/** @scrutinizer ignore-unused */ DummyTaskWasExecuted $event)

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

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