Completed
Push — master ( ad1ec6...dc2720 )
by Rémi
03:15
created

UnableToCreateUserEvent::getUserId()   A

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 0
Metric Value
c 0
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
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 6
    public function __construct(
31
        ApplicationUserId $userId,
32
        UndefinedApplicationUser $user
33
    ) {
34 6
        parent::__construct(self::NAME);
35
36 6
        $this->userId = $userId;
37 6
        $this->user = $user;
38 6
    }
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 3
    public function getUser()
52
    {
53 3
        return $this->user;
54
    }
55
}
56