<?php
/**
* @license SILK SOFTWARE HOUSE SP Z O O
*/
namespace App\EventSubscriber;
use App\Decoder\Interfaces\DecoderInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Class RequestDecryptingSubscriber.
*/
class DataTransformerDependencySubscriber implements EventSubscriberInterface
{
const ACTIONS_SUBSCRIBED = [
'device_measurement_chart_type',
];
public function onKernelController(ControllerEvent $event)
{
$controller = $event->getController();
$request = $event->getRequest();
$route = $request->get('_route');
// when a controller class defines multiple action methods, the controller
// is returned as [$controllerInstance, 'methodName']
if (in_array($route, self::ACTIONS_SUBSCRIBED)) {
dump($route);
}
}
public static function getSubscribedEvents()
{
return [
KernelEvents::CONTROLLER => 'onKernelController',
];
}
}