Skip to content

Commit 81f5f19

Browse files
authored
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 <jrfnl@users.noreply.github.com>
1 parent 6273088 commit 81f5f19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

VariableAnalysis/Lib/Helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ public static function getListAssignments(File $phpcsFile, $listOpenerIndex)
755755
$parentSquareBracket = self::findContainingOpeningSquareBracket($phpcsFile, $listOpenerIndex);
756756
if (is_int($parentSquareBracket)) {
757757
// Collect the opening index, but we don't actually need the closing paren index so just make that 0
758-
$parents[$parentSquareBracket] = 0;
758+
$parents = [$parentSquareBracket => 0];
759759
}
760760
}
761761
// If we have no parents, this is not a nested assignment and therefore is not an assignment

0 commit comments

Comments
 (0)