diff --git a/src/EventListener/JsErrorToAlertListener.php b/src/EventListener/JsErrorToAlertListener.php index b50fdbe..4f8f640 100644 --- a/src/EventListener/JsErrorToAlertListener.php +++ b/src/EventListener/JsErrorToAlertListener.php @@ -7,13 +7,13 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; class JsErrorToAlertListener implements EventSubscriberInterface { - public function onKernelResponse(FilterResponseEvent $event): void + public function onKernelResponse(ResponseEvent $event): void { $response = $event->getResponse(); $request = $event->getRequest(); diff --git a/tests/EventListener/JsErrorToAlertListenerTest.php b/tests/EventListener/JsErrorToAlertListenerTest.php index cf1d7d3..7bef8f1 100644 --- a/tests/EventListener/JsErrorToAlertListenerTest.php +++ b/tests/EventListener/JsErrorToAlertListenerTest.php @@ -10,7 +10,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; +use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\KernelEvents; @@ -52,7 +52,7 @@ public function testScriptIsInjected(string $responseBody, string $expectedRespo { $response = new Response($responseBody); - $event = new FilterResponseEvent( + $event = new ResponseEvent( $this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, @@ -108,7 +108,7 @@ public function testScriptIsNotInjectedOnRedirection(int $statusCode): void { $response = new Response(self::BASIC_HTML, $statusCode); - $event = new FilterResponseEvent( + $event = new ResponseEvent( $this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, @@ -139,7 +139,7 @@ public function testScriptIsNotInjectedToStreamedResponse(): void { $response = new StreamedResponse(); - $event = new FilterResponseEvent( + $event = new ResponseEvent( $this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, @@ -156,7 +156,7 @@ public function testScriptIsNotInjectedOnSubRequest(): void { $response = new Response(self::BASIC_HTML); - $event = new FilterResponseEvent( + $event = new ResponseEvent( $this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::SUB_REQUEST, @@ -176,7 +176,7 @@ public function testScriptIsNotInjectedOnIncompleteHtmlResponses(): void { $response = new Response('