Completed
Push — master ( 8e072a...3d5bb7 )
by Constantin
03:31
created

EventsCommit::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 3
crap 2
1
<?php
2
3
4
namespace Gica\Cqrs\EventStore;
5
6
7
use Gica\Cqrs\Event\EventWithMetaData;
8
9
class EventsCommit
10
{
11
12
    /**
13
     * @var int
14
     */
15
    private $sequence;
16
    /**
17
     * @var int
18
     */
19
    private $version;
20
    /**
21
     * @var EventWithMetaData[]
22
     */
23
    private $eventsWithMetadata;
24
25
    public function __construct(
26
        int $sequence,
27
        int $version,
28
        array $eventsWithMetadata
29
    )
30
    {
31
        $this->sequence = $sequence;
32
        $this->version = $version;
33
        $this->eventsWithMetadata = $eventsWithMetadata;
34
    }
35
36
    /**
37
     * @return int
38
     */
39
    public function getSequence(): int
40
    {
41
        return $this->sequence;
42
    }
43
44
    /**
45
     * @return int
46
     */
47
    public function getVersion(): int
48
    {
49
        return $this->version;
50
    }
51
52
    /**
53
     * @return EventWithMetaData[]
54
     */
55
    public function getEventsWithMetadata(): array
56
    {
57
        return $this->eventsWithMetadata;
58
    }
59
}