Skip to content
Permalink
Browse files

minor #32254 [Security] [Guard] Added type-hints to AuthenticatorInte…

…rface (thomasbisignani)

This PR was merged into the 5.0-dev branch.

Discussion
----------

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

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179
| License       | MIT
| Doc PR        |

This PR adds the type-hints to the AuthenticatorInterface

Commits
-------

51b3c2e [Security] [Guard] Added type-hints to AuthenticatorInterface
  • Loading branch information...
fabpot committed Jul 3, 2019
2 parents 393f9ae + 51b3c2e commit cc9778ed2e098c298cabba42da824e5aa8993f13
@@ -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,
@@ -108,12 +108,9 @@ public function checkCredentials($credentials, UserInterface $user);
*
* @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 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
* 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?
@@ -103,7 +103,7 @@ public function supports(Request $request)
return true;
}
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey)
{
}

0 comments on commit cc9778e

Please sign in to comment.
You can’t perform that action at this time.