From a4d14bcc98ba388102e6247c8039bea3d56cdfbb Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Thu, 22 Dec 2022 16:15:29 +0100 Subject: [PATCH] feat: make call to JsonpCallbackValidator::validate() static --- Controller/Controller.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Controller/Controller.php b/Controller/Controller.php index 22f8305..f5265f6 100644 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpKernel\Exception\HttpException; +use Symfony\Component\Routing\RouteCollection; /** * Controller class. @@ -63,7 +64,7 @@ public function indexAction(Request $request, $_format): Response $serializedRoutes = file_get_contents($path); $exposedRoutes = $this->serializer->deserialize( $serializedRoutes, - 'Symfony\Component\Routing\RouteCollection', + RouteCollection::class, 'json' ); } @@ -83,7 +84,7 @@ public function indexAction(Request $request, $_format): Response if (null !== $callback = $request->query->get('callback')) { $validator = new \JsonpCallbackValidator(); - if (!$validator->validate($callback)) { + if (!$validator::validate($callback)) { throw new HttpException(400, 'Invalid JSONP callback value'); }