From f7fe4a2bee32c90e90cce00eb74c613a3526fe63 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 9 Dec 2023 10:31:56 +0100 Subject: [PATCH] Fix event listeners for Symfony 7 --- src/EventListener/BlameListener.php | 2 +- src/EventListener/IpTraceListener.php | 2 +- src/EventListener/LoggerListener.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EventListener/BlameListener.php b/src/EventListener/BlameListener.php index 77131f05..31e1933d 100644 --- a/src/EventListener/BlameListener.php +++ b/src/EventListener/BlameListener.php @@ -34,7 +34,7 @@ public function __construct(BlameableListener $blameableListener, TokenStorageIn */ public function onKernelRequest(RequestEvent $event) { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + if (!$event->isMainRequest()) { return; } diff --git a/src/EventListener/IpTraceListener.php b/src/EventListener/IpTraceListener.php index 51394c8f..f3fd21d8 100644 --- a/src/EventListener/IpTraceListener.php +++ b/src/EventListener/IpTraceListener.php @@ -22,7 +22,7 @@ public function __construct(IpTraceableListener $ipTraceableListener) public function onKernelRequest(RequestEvent $event) { - if (HttpKernelInterface::MAIN_REQUEST !== $event->getRequestType()) { + if (!$event->isMainRequest()) { return; } diff --git a/src/EventListener/LoggerListener.php b/src/EventListener/LoggerListener.php index 5d4ee01c..f2acfd7b 100644 --- a/src/EventListener/LoggerListener.php +++ b/src/EventListener/LoggerListener.php @@ -33,7 +33,7 @@ public function __construct(LoggableListener $loggableListener, TokenStorageInte */ public function onKernelRequest(RequestEvent $event) { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + if (!$event->isMainRequest()) { return; }