[Security] [Guard] Added type-hints to AuthenticatorInterface

This commit is contained in:
Thomas Bisignani 2019-06-28 14:07:30 +02:00
parent 393f9ae2b5
commit 51b3c2e84e
3 changed files with 4 additions and 13 deletions

View File

@ -25,11 +25,9 @@ abstract class AbstractGuardAuthenticator implements AuthenticatorInterface
* Shortcut to create a PostAuthenticationGuardToken for you, if you don't really
* care about which authenticated token you're using.
*
* @param string $providerKey
*
* @return PostAuthenticationGuardToken
*/
public function createAuthenticatedToken(UserInterface $user, $providerKey)
public function createAuthenticatedToken(UserInterface $user, string $providerKey)
{
return new PostAuthenticationGuardToken(
$user,

View File

@ -108,12 +108,9 @@ interface AuthenticatorInterface extends AuthenticationEntryPointInterface
*
* @see AbstractGuardAuthenticator
*
* @param UserInterface $user
* @param string $providerKey The provider (i.e. firewall) key
*
* @return GuardTokenInterface
*/
public function createAuthenticatedToken(UserInterface $user, $providerKey);
public function createAuthenticatedToken(UserInterface $user, string $providerKey);
/**
* Called when authentication executed, but failed (e.g. wrong username password).
@ -140,13 +137,9 @@ interface AuthenticatorInterface extends AuthenticationEntryPointInterface
* If you return null, the current request will continue, and the user
* will be authenticated. This makes sense, for example, with an API.
*
* @param Request $request
* @param TokenInterface $token
* @param string $providerKey The provider (i.e. firewall) key
*
* @return Response|null
*/
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey);
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey);
/**
* Does this method support remember me cookies?

View File

@ -103,7 +103,7 @@ class TestFormLoginAuthenticator extends AbstractFormLoginAuthenticator
return true;
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey)
{
}