vendor/pgs-soft/hashid-bundle/src/EventSubscriber/DecodeControllerParametersSubscriber.php line 19

Open in your IDE?
  1. <?php
  2. namespace Pgs\HashIdBundle\EventSubscriber;
  3. use Pgs\HashIdBundle\Service\DecodeControllerParameters;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\HttpKernel\Event\ControllerEvent;
  6. use Symfony\Component\HttpKernel\KernelEvents;
  7. class DecodeControllerParametersSubscriber implements EventSubscriberInterface
  8. {
  9.     protected $decodeControllerParameters;
  10.     public function __construct(DecodeControllerParameters $decodeControllerParameters)
  11.     {
  12.         $this->decodeControllerParameters $decodeControllerParameters;
  13.     }
  14.     public function onKernelController(ControllerEvent $event): void
  15.     {
  16.         $this->getDecodeControllerParameters()->decodeControllerParameters($event);
  17.     }
  18.     public static function getSubscribedEvents(): array
  19.     {
  20.         return [
  21.             KernelEvents::CONTROLLER => 'onKernelController',
  22.         ];
  23.     }
  24.     public function getDecodeControllerParameters(): DecodeControllerParameters
  25.     {
  26.         return $this->decodeControllerParameters;
  27.     }
  28. }