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

PostDeletedCommentsIEvent::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 PostDeletedCommentsIEvent extends ApplicationInboundEvent
9
{
10
    const EVENT_NAME = "POST_DELETED";
11
12
    private Ulid $id;
13
14
    /**
15
     * @param array $data
16
     */
17 3
    public function __construct(array $data)
18
    {
19 3
        parent::__construct($data);
20 3
        $this->id = $this->ulid('id');
21 3
    }
22
23
24
    /**
25
     * @return Ulid
26
     */
27 2
    public function getId(): Ulid
28
    {
29 2
        return $this->id;
30
    }
31
32 1
33
    /**
34
     * @return string
35
     */
36
    public static function getName(): string
37
    {
38
        return self::EVENT_NAME;
39
    }
40
}