code cleanup for phpstan level 4 (#1522)

This commit is contained in:
Kevin Papst
2020-03-05 02:15:16 +01:00
committed by GitHub
parent 25a74ffeee
commit 20b3c31cbd
19 changed files with 40 additions and 64 deletions

View File

@@ -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)