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

ThirdPartyAccountReplacedEvent::__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 ThirdPartyAccountReplacedEvent extends Event implements UserEvent
10
{
11
    /**
12
     * @var string
13
     */
14
    const NAME = 'user.3rd-party.replaced';
15
16
    /** @var ApplicationUserId */
17
    private $userId;
18
19
    /** @var Account */
20
    private $thirdPartyAccount;
21
22
    /**
23
     * ThirdPartyAccountLinkedEvent constructor.
24
     *
25
     * @param ApplicationUserId $userId
26
     * @param Account           $thirdPartyAccount
27
     */
28 3
    public function __construct(ApplicationUserId $userId, Account $thirdPartyAccount)
29
    {
30 3
        parent::__construct(self::NAME);
31 3
        $this->userId = $userId;
32 3
        $this->thirdPartyAccount = $thirdPartyAccount;
33 3
    }
34
35
    /**
36
     * @return ApplicationUserId
37
     */
38 3
    public function getUserId()
39
    {
40 3
        return $this->userId;
41
    }
42
43
    /**
44
     * @return Account
45
     */
46 3
    public function getThirdPartyAccount()
47
    {
48 3
        return $this->thirdPartyAccount;
49
    }
50
}
51