Passed
Push — master ( dbfb37...74a6ed )
by Frank
46s queued 13s
created

Snapshot::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EventSauce\EventSourcing\Snapshotting;
6
7
use EventSauce\EventSourcing\AggregateRootId;
8
9
final class Snapshot
10
{
11
    /**
12
     * @var AggregateRootId
13
     */
14
    private $aggregateRootId;
15
16
    /**
17
     * @var int
18
     */
19
    private $aggregateRootVersion;
20
21
    /**
22
     * @var mixed
23
     */
24
    private $state;
25
26 1
    public function __construct(
27
        AggregateRootId $aggregateRootId,
28
        int $aggregateRootVersion,
29
        $state
30
    ) {
31 1
        $this->aggregateRootId = $aggregateRootId;
32 1
        $this->aggregateRootVersion = $aggregateRootVersion;
33 1
        $this->state = $state;
34 1
    }
35
36 1
    public function aggregateRootId(): AggregateRootId
37
    {
38 1
        return $this->aggregateRootId;
39
    }
40
41 1
    public function aggregateRootVersion(): int
42
    {
43 1
        return $this->aggregateRootVersion;
44
    }
45
46 1
    public function state()
47
    {
48 1
        return $this->state;
49
    }
50
}
51