code cleanup for phpstan level 4 (#1522)
This commit is contained in:
@@ -17,7 +17,6 @@ use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProvid
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
||||
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
|
||||
use Symfony\Component\Security\Core\User\ChainUserProvider;
|
||||
use Symfony\Component\Security\Core\User\UserProviderInterface;
|
||||
|
||||
final class SamlProvider implements AuthenticationProviderInterface
|
||||
@@ -51,9 +50,6 @@ final class SamlProvider implements AuthenticationProviderInterface
|
||||
{
|
||||
$user = null;
|
||||
|
||||
/** @var ChainUserProvider $p */
|
||||
$p = $this->userProvider;
|
||||
|
||||
try {
|
||||
$user = $this->userProvider->loadUserByUsername($token->getUsername());
|
||||
} catch (UsernameNotFoundException $e) {
|
||||
@@ -73,14 +69,10 @@ final class SamlProvider implements AuthenticationProviderInterface
|
||||
);
|
||||
}
|
||||
|
||||
if ($user) {
|
||||
$authenticatedToken = $this->tokenFactory->createToken($user, $token->getAttributes(), $user->getRoles());
|
||||
$authenticatedToken->setAuthenticated(true);
|
||||
$authenticatedToken = $this->tokenFactory->createToken($user, $token->getAttributes(), $user->getRoles());
|
||||
$authenticatedToken->setAuthenticated(true);
|
||||
|
||||
return $authenticatedToken;
|
||||
}
|
||||
|
||||
throw new AuthenticationException('The authentication failed.');
|
||||
return $authenticatedToken;
|
||||
}
|
||||
|
||||
public function supports(TokenInterface $token)
|
||||
|
||||
Reference in New Issue
Block a user