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

PostDeletedCommentsIEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A __construct() 0 4 1
A getName() 0 3 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 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
}