From 25374e744ae10dee1632831d628d9df1a6ff2dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Wed, 10 Jul 2024 07:51:23 +0200 Subject: [PATCH] [TASK] Use first class callable syntax for array callbacks --- Classes/Controller/CacheWarmupController.php | 2 +- Classes/Controller/CacheWarmupLegacyController.php | 2 +- Classes/Http/Message/Event/WarmupFinishedEvent.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Classes/Controller/CacheWarmupController.php b/Classes/Controller/CacheWarmupController.php index 4389133b..9f4edddc 100644 --- a/Classes/Controller/CacheWarmupController.php +++ b/Classes/Controller/CacheWarmupController.php @@ -74,7 +74,7 @@ public function __invoke(Message\ServerRequestInterface $request): Message\Respo $warmupRequest = $this->mapper->map(ValueObject\Request\WarmupRequest::class, $request->getQueryParams()); } catch (Valinor\Mapper\MappingError $error) { $errors = Valinor\Mapper\Tree\Message\Messages::flattenFromNode($error->node()); - $messages = array_map('strval', $errors->toArray()); + $messages = array_map(strval(...), $errors->toArray()); $this->logger->error( 'Error during mapping of query parameters to warmup request object.', diff --git a/Classes/Controller/CacheWarmupLegacyController.php b/Classes/Controller/CacheWarmupLegacyController.php index b336169a..256873ef 100644 --- a/Classes/Controller/CacheWarmupLegacyController.php +++ b/Classes/Controller/CacheWarmupLegacyController.php @@ -65,7 +65,7 @@ public function __invoke(Message\ServerRequestInterface $request): Message\Respo $warmupRequest = $this->mapper->map(ValueObject\Request\WarmupRequest::class, $request->getQueryParams()); } catch (Valinor\Mapper\MappingError $error) { $errors = Valinor\Mapper\Tree\Message\Messages::flattenFromNode($error->node()); - $messages = array_map('strval', $errors->toArray()); + $messages = array_map(strval(...), $errors->toArray()); $this->logger->error( 'Error during mapping of query parameters to warmup request object.', diff --git a/Classes/Http/Message/Event/WarmupFinishedEvent.php b/Classes/Http/Message/Event/WarmupFinishedEvent.php index ff1883e5..f757aad4 100644 --- a/Classes/Http/Message/Event/WarmupFinishedEvent.php +++ b/Classes/Http/Message/Event/WarmupFinishedEvent.php @@ -85,12 +85,12 @@ public function getData(): array 'total' => \count($failedUrls) + \count($successfulUrls), ], 'urls' => [ - 'failed' => array_map('strval', $failedUrls), - 'successful' => array_map('strval', $successfulUrls), + 'failed' => array_map(strval(...), $failedUrls), + 'successful' => array_map(strval(...), $successfulUrls), ], 'excluded' => [ - 'sitemaps' => array_map('strval', $this->result->getExcludedSitemaps()), - 'urls' => array_map('strval', $this->result->getExcludedUrls()), + 'sitemaps' => array_map(strval(...), $this->result->getExcludedSitemaps()), + 'urls' => array_map(strval(...), $this->result->getExcludedUrls()), ], 'messages' => $this->buildMessages($state), ];