EventData::getMetadata()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace RayRutjes\GetEventStore;
4
5
final class EventData
6
{
7
    /**
8
     * @var Uuid
9
     */
10
    private $eventId;
11
12
    /**
13
     * @var string
14
     */
15
    private $type;
16
17
    /**
18
     * @var array
19
     */
20
    private $data;
21
22
    /**
23
     * @var array
24
     */
25
    private $metadata;
26
27
    /**
28
     * @param string $eventId
29
     * @param string $type
30
     * @param array  $data
31
     * @param array  $metadata
32
     */
33
    public function __construct(string $eventId, string $type, array $data, array $metadata)
34
    {
35
        $this->eventId = new Uuid($eventId);
36
        $this->type = $type;
37
        $this->data = $data;
38
        $this->metadata = $metadata;
39
    }
40
41
    /**
42
     * @return Uuid
43
     */
44
    public function getEventId(): Uuid
45
    {
46
        return $this->eventId;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getType(): string
53
    {
54
        return $this->type;
55
    }
56
57
    /**
58
     * @return array
59
     */
60
    public function getData(): array
61
    {
62
        return $this->data;
63
    }
64
65
    /**
66
     * @return array
67
     */
68
    public function getMetadata(): array
69
    {
70
        return $this->metadata;
71
    }
72
}
73