From 51b3c2e84eae4b3a7886e7f4652e8b7fd3726dea Mon Sep 17 00:00:00 2001 From: Thomas Bisignani Date: Fri, 28 Jun 2019 14:07:30 +0200 Subject: [PATCH] [Security] [Guard] Added type-hints to AuthenticatorInterface --- .../Security/Guard/AbstractGuardAuthenticator.php | 4 +--- .../Security/Guard/AuthenticatorInterface.php | 11 ++--------- .../Authenticator/FormLoginAuthenticatorTest.php | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Security/Guard/AbstractGuardAuthenticator.php b/src/Symfony/Component/Security/Guard/AbstractGuardAuthenticator.php index d2804de857..8491c69cc8 100644 --- a/src/Symfony/Component/Security/Guard/AbstractGuardAuthenticator.php +++ b/src/Symfony/Component/Security/Guard/AbstractGuardAuthenticator.php @@ -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, diff --git a/src/Symfony/Component/Security/Guard/AuthenticatorInterface.php b/src/Symfony/Component/Security/Guard/AuthenticatorInterface.php index 3ff5b13b83..f2bac3c4c1 100644 --- a/src/Symfony/Component/Security/Guard/AuthenticatorInterface.php +++ b/src/Symfony/Component/Security/Guard/AuthenticatorInterface.php @@ -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? diff --git a/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php index bbc44c8b0a..52d0133040 100644 --- a/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php +++ b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php @@ -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) { }