1 | <?php |
||
13 | final class FormAuthentication implements AuthenticationInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var PasswordManagerInterface |
||
17 | */ |
||
18 | private $passwordManager; |
||
19 | |||
20 | /** |
||
21 | * @var SessionInterface |
||
22 | */ |
||
23 | private $session; |
||
24 | |||
25 | const USER_KEY = 'u'; |
||
26 | |||
27 | /** |
||
28 | * @var RepositoryInterface |
||
29 | */ |
||
30 | private $userRepository; |
||
31 | |||
32 | /** |
||
33 | * @param PasswordManagerInterface $passwordManager |
||
34 | * @param SessionInterface $session |
||
35 | * @param RepositoryInterface $userRepository |
||
36 | */ |
||
37 | public function __construct( |
||
46 | |||
47 | /** |
||
48 | * @param Request $request |
||
49 | * |
||
50 | * @throws AuthenticationExceptionInterface |
||
51 | */ |
||
52 | public function login(Request $request) |
||
68 | |||
69 | /** |
||
70 | * @param array $data |
||
71 | */ |
||
72 | private function checkingRequirements(array $data) |
||
89 | |||
90 | /** |
||
91 | * @param Request $request |
||
92 | */ |
||
93 | public function logout(Request $request) |
||
97 | |||
98 | /** |
||
99 | * @param Request $request |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function isAuthenticated(Request $request): bool |
||
107 | |||
108 | /** |
||
109 | * @param Request $request |
||
110 | * |
||
111 | * @return UserPasswordInterface|null |
||
112 | */ |
||
113 | public function getAuthenticatedUser(Request $request) |
||
132 | } |
||
133 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.