diff --git a/src/EventListener/TagSubscriber.php b/src/EventListener/TagSubscriber.php index 562be8f..7e9df85 100644 --- a/src/EventListener/TagSubscriber.php +++ b/src/EventListener/TagSubscriber.php @@ -12,7 +12,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; -use Symfony\Component\Security\Http\FirewallMapInterface; abstract class TagSubscriber implements EventSubscriberInterface { @@ -37,20 +36,20 @@ abstract class TagSubscriber implements EventSubscriberInterface private $hasAccount; /** - * @var RequestStack|null + * @var RequestStack */ private $requestStack; /** - * @var FirewallMapInterface|null + * @var FirewallMap */ private $firewallMap; public function __construct( TagBagInterface $tagBag, AccountContextInterface $accountContext, - RequestStack $requestStack = null, - FirewallMapInterface $firewallMap = null + RequestStack $requestStack, + FirewallMap $firewallMap ) { $this->tagBag = $tagBag; $this->accountContext = $accountContext; @@ -95,19 +94,7 @@ protected function getAccount(): AccountInterface protected function isShopContext(Request $request = null): bool { - if (null === $this->firewallMap) { - return true; - } - - if (!$this->firewallMap instanceof FirewallMap) { - return true; - } - if (null === $request) { - if (null === $this->requestStack) { - return true; - } - $request = $this->requestStack->getCurrentRequest(); if (null === $request) { return true; diff --git a/src/Resources/config/services/event_listener.xml b/src/Resources/config/services/event_listener.xml index 6790152..c1d50b5 100644 --- a/src/Resources/config/services/event_listener.xml +++ b/src/Resources/config/services/event_listener.xml @@ -8,7 +8,7 @@ - + @@ -18,7 +18,7 @@ %setono_sylius_criteo.routes.home% - + @@ -28,7 +28,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -49,7 +49,7 @@ %setono_sylius_criteo.routes.cart% - + @@ -58,7 +58,7 @@ class="Setono\SyliusCriteoPlugin\EventListener\TrackTransactionSubscriber"> - +