diff --git a/src/Symfony/Toggle.php b/src/Symfony/Toggle.php index 9cb5a0e..99b1cb7 100644 --- a/src/Symfony/Toggle.php +++ b/src/Symfony/Toggle.php @@ -19,7 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; @@ -40,11 +39,6 @@ final class Toggle implements ToggleInterface, ContainerAwareInterface */ private $toggle; - /** - * @var SessionInterface - */ - private $session; - /** * @var TokenStorageInterface */ @@ -72,7 +66,6 @@ final class Toggle implements ToggleInterface, ContainerAwareInterface public function __construct( BaseToggle $toggle, - SessionInterface $session, TokenStorageInterface $tokenStorage, RoleHierarchyInterface $roleHierarchy, RequestStack $requestStack, @@ -80,7 +73,6 @@ public function __construct( AuthorizationCheckerInterface $authorizationChecker ) { $this->toggle = $toggle; - $this->session = $session; $this->tokenStorage = $tokenStorage; $this->roleHierarchy = $roleHierarchy; $this->requestStack = $requestStack; @@ -106,7 +98,7 @@ public function isActive(string $feature, array $context = []): bool 'token' => $token, 'request' => $this->requestStack->getCurrentRequest(), 'roles' => $roles, - 'session' => $this->session, + 'session' => $this->requestStack->getCurrentRequest()->getSession(), 'trust_resolver' => $this->trustResolver, 'auth_checker' => $this->authorizationChecker, 'user' => null !== $token ? $token->getUser() : null,