Completed
Pull Request — master (#473)
by
unknown
02:11
created

AbstractEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUuid() 0 4 1
A serialize() 0 4 1
1
<?php
2
3
namespace CultuurNet\UDB3\Role\Events;
4
5
use Broadway\Serializer\SerializableInterface;
6
use ValueObjects\Identity\UUID;
7
8
abstract class AbstractEvent implements SerializableInterface
9
{
10
    const UUID = 'uuid';
11
12
    /**
13
     * @var UUID
14
     */
15
    private $uuid;
16
17
    /**
18
     * AbstractEvent constructor.
19
     * @param UUID $uuid
20
     */
21
    public function __construct(UUID $uuid)
22
    {
23
        $this->uuid = $uuid;
24
    }
25
26
    /**
27
     * @return UUID
28
     */
29
    public function getUuid()
30
    {
31
        return $this->uuid;
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function serialize()
38
    {
39
        return ['uuid' => $this->getUuid()->toNative()];
40
    }
41
}
42