UnableToCreateUserEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 47
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getUserId() 0 4 1
A getUser() 0 4 1
1
<?php
2
3
namespace MessageApp\Event;
4
5
use League\Event\Event;
6
use MessageApp\User\ApplicationUserId;
7
use MessageApp\User\UndefinedApplicationUser;
8
9
class UnableToCreateUserEvent extends Event
10
{
11
    /**
12
     * @var string
13
     */
14
    const NAME = 'user.failed-creating';
15
16
    /** @var ApplicationUserId */
17
    private $userId;
18
19
    /**
20
     * @var UndefinedApplicationUser
21
     */
22
    private $user;
23
24
    /**
25
     * Constructor
26
     *
27
     * @param ApplicationUserId        $userId
28
     * @param UndefinedApplicationUser $user
29
     */
30 15
    public function __construct(
31
        ApplicationUserId $userId,
32
        UndefinedApplicationUser $user
33
    ) {
34 15
        parent::__construct(self::NAME);
35
36 15
        $this->userId = $userId;
37 15
        $this->user = $user;
38 15
    }
39
40
    /**
41
     * @return ApplicationUserId
42
     */
43 3
    public function getUserId()
44
    {
45 3
        return $this->userId;
46
    }
47
48
    /**
49
     * @return UndefinedApplicationUser
50
     */
51 9
    public function getUser()
52
    {
53 9
        return $this->user;
54
    }
55
}
56