EventData   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 68
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getEventId() 0 4 1
A getType() 0 4 1
A getData() 0 4 1
A getMetadata() 0 4 1
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