From 81f5f19ceaa545ae0e01bae18771467c3daf8d4b Mon Sep 17 00:00:00 2001 From: Juliette <663378+jrfnl@users.noreply.github.com> Date: Sun, 16 Oct 2022 01:24:19 +0200 Subject: [PATCH] QA: minor code tweak (#282) This fixes the following error from PHPStan: ``` ------ --------------------------------------------------------- Line Lib/Helpers.php ------ --------------------------------------------------------- 758 Cannot access offset int on 0|0.0|''|'0'|array{}|false. ------ --------------------------------------------------------- ``` Co-authored-by: jrfnl --- VariableAnalysis/Lib/Helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 30f7735..9b03bcd 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -755,7 +755,7 @@ public static function getListAssignments(File $phpcsFile, $listOpenerIndex) $parentSquareBracket = self::findContainingOpeningSquareBracket($phpcsFile, $listOpenerIndex); if (is_int($parentSquareBracket)) { // Collect the opening index, but we don't actually need the closing paren index so just make that 0 - $parents[$parentSquareBracket] = 0; + $parents = [$parentSquareBracket => 0]; } } // If we have no parents, this is not a nested assignment and therefore is not an assignment