Completed
Push — master ( d252f0...d75c62 )
by Jonas
22s queued 11s
created

AbstractEvent::deserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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
    public const UUID = 'uuid';
11
12
    /**
13
     * @var UUID
14
     */
15
    private $uuid;
16
17
    public function __construct(UUID $uuid)
18
    {
19
        $this->uuid = $uuid;
20
    }
21
22
    public function getUuid(): UUID
23
    {
24
        return $this->uuid;
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function serialize(): array
31
    {
32
        return ['uuid' => $this->getUuid()->toNative()];
33
    }
34
}
35