I have a EventSubscriber and the onKernelRequest
method is not called when APP_ENV=prod
. If APP_ENV=dev
the onKernelRequest
method is called.
The method getSubscribedEvents()
is called if APP_ENV=prod
and APP_ENV=dev
.
I only change the value in the .env.local
. I have no APP_ENV configuration regarding EventSubscriber.
Symfony version: 6.4.7
use SymfonyComponentEventDispatcherEventSubscriberInterface;
use SymfonyComponentHttpKernelEventRequestEvent;
use SymfonyComponentHttpKernelKernelEvents;
class RequestEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
KernelEvents::REQUEST => [
['onKernelRequest', 0]
]
];
}
public function onKernelRequest(RequestEvent $event): void
{
// Stuff
}
}