UserCreatedEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 64
ccs 12
cts 12
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getUserId() 0 4 1
A getUsername() 0 4 1
A getPreferredLanguage() 0 4 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