Passed
Push — main ( 79e4f1...ed1bb6 )
by Slawomir
04:28
created

PostUpdatedCommentsIEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 56
ccs 15
cts 15
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getLastVersion() 0 3 1
A getTitle() 0 3 1
A getTags() 0 3 1
A __construct() 0 7 1
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(self::EVENT_NAME, $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
}