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

UserRenamedPostsIEvent::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\Posts\Api\Event\Inbound;
4
5
use App\Infrastructure\Events\ApplicationInboundEvent;
6
7
class UserRenamedPostsIEvent extends ApplicationInboundEvent
8
{
9
    const EVENT_NAME = "USER_RENAMED";
10
11
    private string $oldLogin;
12
13
    private string $newLogin;
14
15
    /**
16
     * @param array $data
17
     */
18 3
    public function __construct(array $data)
19
    {
20 3
        parent::__construct( $data);
21 3
        $this->oldLogin = $this->string('oldLogin');
22 3
        $this->newLogin = $this->string('newLogin');
23 3
    }
24
25
    /**
26
     * @return string
27
     */
28 2
    public function getOldLogin(): string
29
    {
30 2
        return $this->oldLogin;
31
    }
32
33
    /**
34
     * @return string
35
     */
36 2
    public function getNewLogin(): string
37
    {
38 2
        return $this->newLogin;
39
    }
40
41
    /**
42 1
     * @return string
43
     */
44
    public static function getName(): string
45
    {
46
        return self::EVENT_NAME;
47
    }
48
}