| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | class U2fAuthenticationSuccessEvent extends Event |
||
| 28 | { |
||
| 29 | private $user; |
||
| 30 | private $key; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Return the name of the event to use when dispatching this event. |
||
| 34 | * |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | 1 | public static function getName() |
|
| 38 | { |
||
| 39 | 1 | return 'u2f.authentication.success'; |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param U2fUserInterface $user The user who successfully authenticated |
||
| 44 | * @param U2fKeyInterface $key The security key used during the authentication |
||
| 45 | */ |
||
| 46 | 3 | public function __construct(U2fUserInterface $user, U2fKeyInterface $key) |
|
| 47 | { |
||
| 48 | 3 | $this->user = $user; |
|
| 49 | 3 | $this->key = $key; |
|
| 50 | 3 | } |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Return the user who successfully authenticated with it U2F key. |
||
| 54 | * |
||
| 55 | * @return U2fUserInterface |
||
| 56 | */ |
||
| 57 | 1 | public function getUser() |
|
| 58 | { |
||
| 59 | 1 | return $this->user; |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Return the key used to authenticate. The counter of the key has already been updated. |
||
| 64 | * |
||
| 65 | * @return U2fKeyInterface |
||
| 66 | */ |
||
| 67 | 1 | public function getKey() |
|
| 70 | } |
||
| 71 | } |
||
| 72 |