From f5d262ada498261d4a716ee21c7df997bb352cba Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Sun, 14 Jun 2020 18:55:48 +0200 Subject: [PATCH] Fix Symfony 5.1 deprecation Since symfony/http-foundation 5.1: The "Symfony\Component\HttpFoundation\Response::create()" method is deprecated, use "new Symfony\Component\HttpFoundation\Response()" instead. --- src/JsonRequestTransformerListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonRequestTransformerListener.php b/src/JsonRequestTransformerListener.php index ee2b83e..9ed6d4f 100755 --- a/src/JsonRequestTransformerListener.php +++ b/src/JsonRequestTransformerListener.php @@ -37,7 +37,7 @@ public function onKernelRequest(RequestEvent $event): void } if (!$this->transformJsonBody($request)) { - $response = Response::create('Unable to parse request.', Response::HTTP_BAD_REQUEST); + $response = new Response('Unable to parse request.', Response::HTTP_BAD_REQUEST); $event->setResponse($response); } }