Passed
Push — main ( dc275a...8e4fcf )
by Slawomir
04:22
created

PostBaselinedCommentsIEvent::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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 PostBaselinedCommentsIEvent extends ApplicationInboundEvent
9
{
10
    const EVENT_NAME = "POST_BASELINED";
11
12
    private Ulid $id;
13
14
    private string $title;
15
16
    private array $tags;
17
18
    private int $version;
19
20
    /**
21
     * @param array $data
22
     */
23
    public function __construct(array $data)
24
    {
25
        parent::__construct($data);
26
        $this->id = $this->ulid('id');
27
        $this->title = $this->string('title');
28
        $this->tags = $this->array('tags');
29
        $this->version = $this->int('version');
30
    }
31
32
    /**
33
     * @return Ulid
34
     */
35
    public function getId(): Ulid
36
    {
37
        return $this->id;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getTitle(): string
44
    {
45
        return $this->title;
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function getTags(): array
52
    {
53
        return $this->tags;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getVersion(): int
60
    {
61
        return $this->version;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public static function getName(): string
68
    {
69
        return self::EVENT_NAME;
70
    }
71
72
}