Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | final class TwoFactorAuthenticationWasEnabled |
||
14 | { |
||
15 | private $email; |
||
16 | private $secretKey; |
||
17 | private $recoveryCodes; |
||
18 | |||
19 | 8 | public function __construct( |
|
20 | Email $email, |
||
21 | SecretKey $secretKey, |
||
22 | SetInterface $recoveryCodes |
||
23 | ) { |
||
24 | 8 | if ((string) $recoveryCodes->type() !== RecoveryCode::class) { |
|
25 | 1 | throw new \TypeError(sprintf( |
|
26 | 1 | 'Argument 3 must be of type SetInterface<%s>', |
|
27 | 1 | RecoveryCode::class |
|
28 | )); |
||
29 | } |
||
30 | |||
31 | 7 | $this->email = $email; |
|
32 | 7 | $this->secretKey = $secretKey; |
|
33 | 7 | $this->recoveryCodes = $recoveryCodes; |
|
34 | 7 | } |
|
35 | |||
36 | 2 | public function email(): Email |
|
39 | } |
||
40 | |||
41 | 2 | public function secretKey(): SecretKey |
|
42 | { |
||
43 | 2 | return $this->secretKey; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return SetInterface<RecoveryCode> |
||
48 | */ |
||
49 | 4 | public function recoveryCodes(): SetInterface |
|
52 | } |
||
53 | } |
||
54 |