Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Nov 16, 2023
1 parent 7abeb21 commit c7d9a75
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions application/src/View/Helper/PageLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public function render(SitePageRepresentation $page)
case 'grid':
$gridColumns = (int) $page->layoutDataValue('grid_columns');
$blockLayoutData = $block->layoutData();
$getValidPosition = fn($columnPosition) => in_array($columnPosition, ['auto',...range(1, $gridColumns)]) ? $columnPosition : 'auto';
$getValidSpan = fn($columnSpan) => in_array($columnSpan, range(1, $gridColumns)) ? $columnSpan : $gridColumns;
$getValidPosition = fn ($columnPosition) => in_array($columnPosition, ['auto',...range(1, $gridColumns)]) ? $columnPosition : 'auto';
$getValidSpan = fn ($columnSpan) => in_array($columnSpan, range(1, $gridColumns)) ? $columnSpan : $gridColumns;
echo sprintf(
'<div style="grid-column: %s / span %s">%s</div>',
$getValidPosition($blockLayoutData['grid_column_position'] ?? 'auto'),
Expand All @@ -85,6 +85,5 @@ public function render(SitePageRepresentation $page)
}
}
echo '</div>';

}
}

0 comments on commit c7d9a75

Please sign in to comment.