From 7a8a563fb20097e43155b89917c76cb308148278 Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Tue, 1 Sep 2026 16:27:28 +0200 Subject: [PATCH] Use intval() instead of a cast operator for the panel row number CI (fresh contao/core-bundle ~5.7.0) infers StringUtil::trimsplit()'s keys as strictly int, so psalm flags the (int) cast as redundant there. The devstack's pinned core-bundle version infers a broader array-key type, where the cast is not redundant - removing it outright breaks locally (InvalidOperand). intval() is behaviorally identical to the cast but isn't covered by psalm's RedundantCast rule, so it satisfies both environments. --- .../EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php index a6a171d86..55016b5e5 100644 --- a/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php +++ b/src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder/PanelBuilder.php @@ -104,7 +104,7 @@ protected function build(IMetaModelDataDefinition $container) $panelRows = $panel->getRows(); foreach ($arrRows as $rowNo => $rowElements) { // Get the row, if we have one or create a new one. - if ($panelRows->getRowCount() < ((int) $rowNo + 1)) { + if ($panelRows->getRowCount() < (\intval($rowNo) + 1)) { $panelRow = $panelRows->addRow(); } else { $panelRow = $panelRows->getRow($rowNo);