From b58ceaf2ba4a364a0ef438e9a82abc9e7b362059 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 11 Apr 2024 10:02:55 +0200 Subject: [PATCH] Shorten array map for casting to use existing native function --- Classes/Domain/Factory/RootlineFactory.php | 2 +- Classes/Domain/Model/Scaling.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Domain/Factory/RootlineFactory.php b/Classes/Domain/Factory/RootlineFactory.php index e5a15b5..b954ad5 100644 --- a/Classes/Domain/Factory/RootlineFactory.php +++ b/Classes/Domain/Factory/RootlineFactory.php @@ -92,7 +92,7 @@ public function determineBackendLayoutColumns(): void ); assert(is_array($columns)); - $this->columns = array_map(static fn ($column): int => (int) $column, array_keys($columns)); + $this->columns = array_map('intval', array_keys($columns)); } private function createBackendLayoutRootlineElement(TypoScriptFrontendController $tsfe): void diff --git a/Classes/Domain/Model/Scaling.php b/Classes/Domain/Model/Scaling.php index 545b237..d4a5ed2 100644 --- a/Classes/Domain/Model/Scaling.php +++ b/Classes/Domain/Model/Scaling.php @@ -38,11 +38,11 @@ final class Scaling public function __construct(array $multiplier, array $sizes) { if (!empty($multiplier)) { - $this->multiplier = array_map(static fn ($multiplier): float => (float) $multiplier, $multiplier); + $this->multiplier = array_map('floatval', $multiplier); } if (!empty($sizes)) { - $this->sizes = array_map(static fn ($size): int => (int) $size, $sizes); + $this->sizes = array_map('intval', $sizes); } }