Passed
Push — main ( ed1bb6...4383ba )
by Slawomir
04:39
created

PostUpdatedCommentsIEvent::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Modules\Comments\Api\Event\Inbound;
4
5
use App\Infrastructure\Events\ApplicationInboundEvent;
6
use Symfony\Component\Uid\Ulid;
7
8
class PostUpdatedCommentsIEvent extends ApplicationInboundEvent
9
{
10
    const EVENT_NAME = "POST_UPDATED";
11
12
    private Ulid $id;
13
14
    private string $title;
15
16
17
    private array $tags;
18
19
    private int $lastVersion;
20
21
    /**
22
     * @param array $data
23
     */
24
    public function __construct(array $data)
25
    {
26
        parent::__construct($data);
27 5
        $this->id = $this->ulid('id');
28
        $this->title = $this->string('title');
29 5
        $this->tags = $this->array('tags');
30 5
        $this->lastVersion = $this->int('lastVersion');
31 5
    }
32 5
33 5
34 5
    /**
35 5
     * @return Ulid
36 5
     */
37
    public function getId(): Ulid
38
    {
39
        return $this->id;
40
    }
41
42 4
    /**
43
     * @return string
44 4
     */
45
    public function getTitle(): string
46
    {
47
        return $this->title;
48
    }
49
50 4
    /**
51
     * @return array
52 4
     */
53
    public function getTags(): array
54
    {
55
        return $this->tags;
56
    }
57
58 4
    /**
59
     * @return int
60 4
     */
61
    public function getLastVersion(): int
62
    {
63
        return $this->lastVersion;
64
    }
65
66 4
67
    /**
68 4
     * @return string
69
     */
70
    public static function getName(): string
71
    {
72
        return self::EVENT_NAME;
73
    }
74
}