vendor/scheb/two-factor-bundle/Security/Authentication/AuthenticationTrustResolver.php line 25

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Scheb\TwoFactorBundle\Security\Authentication;
  4. use Scheb\TwoFactorBundle\Security\Authentication\Token\TwoFactorTokenInterface;
  5. use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
  6. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  7. class AuthenticationTrustResolver implements AuthenticationTrustResolverInterface
  8. {
  9.     /**
  10.      * @var AuthenticationTrustResolverInterface
  11.      */
  12.     private $decoratedTrustResolver;
  13.     public function __construct(AuthenticationTrustResolverInterface $decoratedTrustResolver)
  14.     {
  15.         $this->decoratedTrustResolver $decoratedTrustResolver;
  16.     }
  17.     public function isAnonymous(TokenInterface $token null)
  18.     {
  19.         return $this->decoratedTrustResolver->isAnonymous($token);
  20.     }
  21.     public function isRememberMe(TokenInterface $token null)
  22.     {
  23.         return $this->decoratedTrustResolver->isRememberMe($token);
  24.     }
  25.     public function isFullFledged(TokenInterface $token null)
  26.     {
  27.         return !$this->isTwoFactorToken($token) && $this->decoratedTrustResolver->isFullFledged($token);
  28.     }
  29.     private function isTwoFactorToken(?TokenInterface $token): bool
  30.     {
  31.         return $token instanceof TwoFactorTokenInterface;
  32.     }
  33. }