Deprecated: Optional parameter $limit declared before required parameter $order is implicitly treated as a required parameter in /home/u536844918/domains/danzelklassic.com/siteFiles/lib/boab/cms-bundle/src/Repository/ContentRepositoryInterface.php on line 33

Deprecated: Optional parameter $limit declared before required parameter $order is implicitly treated as a required parameter in /home/u536844918/domains/danzelklassic.com/siteFiles/lib/boab/cms-bundle/src/Repository/ContentRepository.php on line 316

Deprecated: Optional parameter $orderBy declared before required parameter $order is implicitly treated as a required parameter in /home/u536844918/domains/danzelklassic.com/siteFiles/lib/boab/cms-bundle/src/Repository/ContentRepository.php on line 316

Deprecated: Optional parameter $data declared before required parameter $page is implicitly treated as a required parameter in /home/u536844918/domains/danzelklassic.com/siteFiles/lib/boab/cms-bundle/src/Manager/ContentTypeManager.php on line 178
Symfony Profiler

vendor/symfony/http-kernel/EventListener/ResponseListener.php line 39

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\HttpKernel\EventListener;
  11. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  13. use Symfony\Component\HttpKernel\KernelEvents;
  14. /**
  15.  * ResponseListener fixes the Response headers based on the Request.
  16.  *
  17.  * @author Fabien Potencier <fabien@symfony.com>
  18.  *
  19.  * @final
  20.  */
  21. class ResponseListener implements EventSubscriberInterface
  22. {
  23.     private string $charset;
  24.     private bool $addContentLanguageHeader;
  25.     public function __construct(string $charsetbool $addContentLanguageHeader false)
  26.     {
  27.         $this->charset $charset;
  28.         $this->addContentLanguageHeader $addContentLanguageHeader;
  29.     }
  30.     /**
  31.      * Filters the Response.
  32.      */
  33.     public function onKernelResponse(ResponseEvent $event)
  34.     {
  35.         if (!$event->isMainRequest()) {
  36.             return;
  37.         }
  38.         $response $event->getResponse();
  39.         if (null === $response->getCharset()) {
  40.             $response->setCharset($this->charset);
  41.         }
  42.         if ($this->addContentLanguageHeader && !$response->isInformational() && !$response->isEmpty() && !$response->headers->has('Content-Language')) {
  43.             $response->headers->set('Content-Language'$event->getRequest()->getLocale());
  44.         }
  45.         if ($event->getRequest()->attributes->get('_vary_by_language')) {
  46.             $response->setVary('Accept-Language'false);
  47.         }
  48.         $response->prepare($event->getRequest());
  49.     }
  50.     public static function getSubscribedEvents(): array
  51.     {
  52.         return [
  53.             KernelEvents::RESPONSE => 'onKernelResponse',
  54.         ];
  55.     }
  56. }