custom/plugins/WbfkExtensions/src/Storefront/Framework/Routing/StorefrontSubscriberDecorator.php line 93

Open in your IDE?
  1. <?php
  2. namespace WbfkExtensions\Storefront\Framework\Routing;
  3. use Shopware\Core\Checkout\Customer\Event\CustomerLoginEvent;
  4. use Shopware\Core\Framework\Event\BeforeSendResponseEvent;
  5. use Shopware\Core\Framework\Routing\Event\SalesChannelContextResolvedEvent;
  6. use Shopware\Storefront\Event\StorefrontRenderEvent;
  7. use Shopware\Storefront\Framework\Routing\StorefrontSubscriber;
  8. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  9. use Symfony\Component\HttpKernel\Event\ControllerEvent;
  10. use Symfony\Component\HttpKernel\Event\ExceptionEvent;
  11. use Symfony\Component\HttpKernel\Event\RequestEvent;
  12. use WbfkExtensions\Service\OrderDeepLinkContextService;
  13. class StorefrontSubscriberDecorator implements EventSubscriberInterface
  14. {
  15.     public function __construct(
  16.         private readonly EventSubscriberInterface $decorated
  17.     ) {
  18.     }
  19.     /**
  20.      * @inheritDoc
  21.      */
  22.     public static function getSubscribedEvents(): array
  23.     {
  24.         return StorefrontSubscriber::getSubscribedEvents();
  25.     }
  26.     public function startSession(): void
  27.     {
  28.         $this->decorated->startSession();
  29.     }
  30.     public function updateSessionAfterLogin(CustomerLoginEvent $event): void
  31.     {
  32.         $this->decorated->updateSessionAfterLogin($event);
  33.     }
  34.     public function updateSessionAfterLogout(): void
  35.     {
  36.         $this->decorated->updateSessionAfterLogout();
  37.     }
  38.     public function updateSession(string $tokenbool $destroyOldSession false): void
  39.     {
  40.         $this->decorated->updateSession($token$destroyOldSession);
  41.     }
  42.     public function showHtmlExceptionResponse(ExceptionEvent $event): void
  43.     {
  44.         $this->decorated->showHtmlExceptionResponse($event);
  45.     }
  46.     public function customerNotLoggedInHandler(ExceptionEvent $event): void
  47.     {
  48.         $this->decorated->customerNotLoggedInHandler($event);
  49.     }
  50.     public function maintenanceResolver(RequestEvent $event): void
  51.     {
  52.         $this->decorated->maintenanceResolver($event);
  53.     }
  54.     public function preventPageLoadingFromXmlHttpRequest(ControllerEvent $event): void
  55.     {
  56.         $this->decorated->preventPageLoadingFromXmlHttpRequest($event);
  57.     }
  58.     public function replaceContextToken(SalesChannelContextResolvedEvent $event): void
  59.     {
  60.         $contextToken $event->getSalesChannelContext()->getToken();
  61.         // Never replace context token if it is an order context token
  62.         // Access to this context should be available only for current request
  63.         if (str_starts_with($contextTokenOrderDeepLinkContextService::ORDER_CONTEXT_TOKEN_PREFIX)) {
  64.             return;
  65.         }
  66.         $this->decorated->replaceContextToken($event);
  67.     }
  68.     public function setCanonicalUrl(BeforeSendResponseEvent $event): void
  69.     {
  70.         $this->decorated->setCanonicalUrl($event);
  71.     }
  72.     public function replaceCsrfToken(BeforeSendResponseEvent $event): void
  73.     {
  74.         $this->decorated->replaceCsrfToken($event);
  75.     }
  76.     public function addHreflang(StorefrontRenderEvent $event): void
  77.     {
  78.         $this->decorated->addHreflang($event);
  79.     }
  80.     public function addShopIdParameter(StorefrontRenderEvent $event): void
  81.     {
  82.         $this->decorated->addShopIdParameter($event);
  83.     }
  84.     public function addIconSetConfig(StorefrontRenderEvent $event): void
  85.     {
  86.         $this->decorated->addIconSetConfig($event);
  87.     }
  88. }