Completed
Push — master ( 7b793b...0c1dad )
by Rémi
04:09
created

ThirdPartyAccountLinkedEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
3
namespace MessageApp\Event;
4
5
use League\Event\Event;
6
use MessageApp\User\ApplicationUserId;
7
use MessageApp\User\ThirdParty\Account;
8
9
class ThirdPartyAccountLinkedEvent extends Event implements UserEvent
10
{
11
    /** @var string */
12
    const NAME = 'user.3rd-party.linked';
13
14
    /** @var ApplicationUserId */
15
    private $userId;
16
17
    /** @var Account */
18
    private $thirdPartyAccount;
19
20
    /**
21
     * ThirdPartyAccountLinkedEvent constructor.
22
     *
23
     * @param ApplicationUserId $userId
24
     * @param Account           $thirdPartyAccount
25
     */
26 3
    public function __construct(ApplicationUserId $userId, Account $thirdPartyAccount)
27
    {
28 3
        parent::__construct(self::NAME);
29 3
        $this->userId = $userId;
30 3
        $this->thirdPartyAccount = $thirdPartyAccount;
31 3
    }
32
33
    /**
34
     * @return ApplicationUserId
35
     */
36 3
    public function getUserId()
37
    {
38 3
        return $this->userId;
39
    }
40
41
    /**
42
     * @return Account
43
     */
44 3
    public function getThirdPartyAccount()
45
    {
46 3
        return $this->thirdPartyAccount;
47
    }
48
}
49