Skip to content

Commit

Permalink
Remove session service usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup authored Jun 4, 2024
1 parent 6f652dc commit 2a31e6b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Symfony/Toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,11 +39,6 @@ final class Toggle implements ToggleInterface, ContainerAwareInterface
*/
private $toggle;

/**
* @var SessionInterface
*/
private $session;

/**
* @var TokenStorageInterface
*/
Expand Down Expand Up @@ -72,15 +66,13 @@ final class Toggle implements ToggleInterface, ContainerAwareInterface

public function __construct(
BaseToggle $toggle,
SessionInterface $session,
TokenStorageInterface $tokenStorage,
RoleHierarchyInterface $roleHierarchy,
RequestStack $requestStack,
AuthenticationTrustResolverInterface $trustResolver,
AuthorizationCheckerInterface $authorizationChecker
) {
$this->toggle = $toggle;
$this->session = $session;
$this->tokenStorage = $tokenStorage;
$this->roleHierarchy = $roleHierarchy;
$this->requestStack = $requestStack;
Expand All @@ -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,
Expand Down

0 comments on commit 2a31e6b

Please sign in to comment.