UserCreatedEvent::getPreferredLanguage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace MessageApp\Event;
4
5
use League\Event\Event;
6
use MessageApp\User\ApplicationUserId;
7
8
class UserCreatedEvent extends Event implements UserEvent
9
{
10
    /**
11
     * @var string
12
     */
13
    const NAME = 'user.created';
14
15
    /**
16
     * @var string
17
     */
18
    private $username;
19
20
    /**
21
     * @var ApplicationUserId
22
     */
23
    private $userId;
24
25
    /**
26
     * @var string
27
     */
28
    private $preferredLanguage;
29
30
    /**
31
     * Constructor
32
     *
33
     * @param ApplicationUserId $id
34
     * @param string            $username
35
     * @param string            $preferredLanguage
36
     */
37 18
    public function __construct(
38
        ApplicationUserId $id,
39
        $username,
40
        $preferredLanguage
41
    ) {
42 18
        parent::__construct(self::NAME);
43 18
        $this->userId = $id;
44 18
        $this->username = $username;
45 18
        $this->preferredLanguage = $preferredLanguage;
46 18
    }
47
48
    /**
49
     * @return ApplicationUserId
50
     */
51 18
    public function getUserId()
52
    {
53 18
        return $this->userId;
54
    }
55
56
    /**
57
     * @return string
58
     */
59 18
    public function getUsername()
60
    {
61 18
        return $this->username;
62
    }
63
64
    /**
65
     * @return string
66
     */
67 18
    public function getPreferredLanguage()
68
    {
69 18
        return $this->preferredLanguage;
70
    }
71
}
72