Skip to content

Commit

Permalink
Shorten array map for casting to use existing native function
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSiepmann committed Apr 11, 2024
1 parent 6669cc2 commit b58ceaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Domain/Factory/RootlineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Scaling.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit b58ceaf

Please sign in to comment.