src/WellCommerce/Bundle/AppBundle/EventListener/HttpCacheSubscriber.php line 52

Open in your IDE?
  1. <?php
  2. declare(strict_types=0);
  3. /*
  4.  * WellCommerce Foundation
  5.  *
  6.  * This file is part of the WellCommerce package.
  7.  *
  8.  * (c) Adam Piotrowski <adam@wellcommerce.org>, Adrian Potepa <adrian@wellcommerce.org>
  9.  *
  10.  * For the full copyright and license information,
  11.  * please view the LICENSE file that was distributed with this source code.
  12.  */
  13. namespace WellCommerce\Bundle\AppBundle\EventListener;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
  16. use Symfony\Component\HttpKernel\KernelEvents;
  17. use WellCommerce\Bundle\CoreBundle\Helper\Security\SecurityHelperInterface;
  18. use WellCommerce\Bundle\OrderBundle\Provider\Front\OrderProviderInterface;
  19. /**
  20.  * Class HttpCacheSubscriber
  21.  *
  22.  * @package WellCommerce\Bundle\AppBundle\EventListener
  23.  */
  24. class HttpCacheSubscriber implements EventSubscriberInterface
  25. {
  26.     /**
  27.      * @var SecurityHelperInterface
  28.      */
  29.     protected $securityHelper;
  30.     /**
  31.      * @var OrderProviderInterface
  32.      */
  33.     protected $orderProvider;
  34.     public function __construct(SecurityHelperInterface $securityHelperOrderProviderInterface $orderProvider)
  35.     {
  36.         $this->securityHelper $securityHelper;
  37.         $this->orderProvider  $orderProvider;
  38.     }
  39.     public static function getSubscribedEvents()
  40.     {
  41.         return [
  42.             KernelEvents::RESPONSE => ['onKernelResponse', -1200],
  43.         ];
  44.     }
  45.     public function onKernelResponse(FilterResponseEvent $event)
  46.     {
  47.         if (!$event->isMasterRequest()) {
  48.             return;
  49.         }
  50.     }
  51. }