Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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