Skip to content

Commit

Permalink
[Security] [Guard] Added type-hints to AuthenticatorInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbisignani committed Jul 2, 2019
1 parent 393f9ae commit 51b3c2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 2 additions & 9 deletions src/Symfony/Component/Security/Guard/AuthenticatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down

0 comments on commit 51b3c2e

Please sign in to comment.