1 | <?php |
||
27 | final class SecurityAuthenticator implements |
||
28 | SimplePreAuthInterface, |
||
29 | AuthenticationFailureHandlerInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Authentication can be required to use any service |
||
34 | * @var bool, |
||
35 | */ |
||
36 | protected $securityRequired; |
||
37 | |||
38 | /** |
||
39 | * Authentication can use a test user if no user found |
||
40 | * @var bool, |
||
41 | */ |
||
42 | protected $securityTestUsername; |
||
43 | |||
44 | /** |
||
45 | * Authentication can allow not identified users to get information |
||
46 | * @var bool, |
||
47 | */ |
||
48 | protected $allowAnonymous; |
||
49 | |||
50 | /** |
||
51 | * @var AuthenticationProvider |
||
52 | */ |
||
53 | protected $userProvider; |
||
54 | |||
55 | /** |
||
56 | * @var StrategyInterface |
||
57 | */ |
||
58 | protected $extractionStrategy; |
||
59 | |||
60 | /** |
||
61 | * @var Logger |
||
62 | */ |
||
63 | protected $logger; |
||
64 | |||
65 | |||
66 | /** |
||
67 | * @param boolean $securityRequired user provider to use |
||
68 | * @param string $securityTestUsername user for testing |
||
69 | * @param boolean $allowAnonymous user provider to use |
||
70 | * @param AuthenticationProvider $userProvider user provider to use |
||
71 | * @param StrategyInterface $extractionStrategy auth strategy to use |
||
72 | * @param Logger $logger logger to user for logging errors |
||
73 | */ |
||
74 | 15 | public function __construct( |
|
91 | |||
92 | /** |
||
93 | * @param Request $request request to authenticate |
||
94 | * @param string $providerKey provider key to auth with |
||
95 | * |
||
96 | * @return \Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken |
||
97 | */ |
||
98 | 7 | public function createToken(Request $request, $providerKey) |
|
109 | |||
110 | /** |
||
111 | * Tries to authenticate the provided token |
||
112 | * |
||
113 | * @param TokenInterface $token token to authenticate |
||
114 | * @param UserProviderInterface $userProvider provider to auth against |
||
115 | * @param string $providerKey key to auth with |
||
116 | * |
||
117 | * @return \Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken |
||
118 | */ |
||
119 | 4 | public function authenticateToken( |
|
168 | 3 | ||
169 | /** |
||
170 | 3 | * @param TokenInterface $token token to check |
|
171 | * @param string $providerKey provider to check against |
||
172 | * |
||
173 | * @return bool |
||
174 | */ |
||
175 | public function supportsToken(TokenInterface $token, $providerKey) |
||
179 | |||
180 | /** |
||
181 | * This is called when an interactive authentication attempt fails. This is |
||
182 | * called by authentication listeners inheriting from |
||
183 | 1 | * AbstractAuthenticationListener. |
|
184 | * |
||
185 | 1 | * @param Request $request original request |
|
186 | 1 | * @param AuthenticationException $exception exception from auth attempt |
|
187 | * |
||
188 | 1 | * @return Response|null |
|
189 | */ |
||
190 | public function onAuthenticationFailure(Request $request, AuthenticationException $exception) |
||
197 | } |
||
198 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: