1 | <?php |
||
14 | final class FormAuthentication implements AuthenticationInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var SessionInterface |
||
18 | */ |
||
19 | private $session; |
||
20 | |||
21 | /** |
||
22 | * @var RepositoryInterface |
||
23 | */ |
||
24 | private $userRepository; |
||
25 | |||
26 | /** |
||
27 | * @param SessionInterface $session |
||
28 | * @param RepositoryInterface $userRepository |
||
29 | */ |
||
30 | public function __construct(SessionInterface $session, RepositoryInterface $userRepository) |
||
35 | |||
36 | /** |
||
37 | * @param Request $request |
||
38 | * |
||
39 | * @throws InvalidPasswordException |
||
40 | * @throws UserNotFoundException |
||
41 | */ |
||
42 | public function login(Request $request) |
||
57 | |||
58 | /** |
||
59 | * @param Request $request |
||
60 | */ |
||
61 | public function logout(Request $request) |
||
65 | |||
66 | /** |
||
67 | * @param Request $request |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function isAuthenticated(Request $request): bool |
||
75 | |||
76 | /** |
||
77 | * @param Request $request |
||
78 | * |
||
79 | * @return FormAuthenticationUserInterface|null |
||
80 | */ |
||
81 | public function getAuthenticatedUser(Request $request) |
||
91 | |||
92 | /** |
||
93 | * @param string $password |
||
94 | * |
||
95 | * @return string |
||
96 | * |
||
97 | * @throws EmptyPasswordException |
||
98 | */ |
||
99 | public function hashPassword(string $password): string |
||
107 | } |
||
108 |