Skip to content

Commit

Permalink
QA: minor code tweak (#282)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jrfnl and jrfnl authored Oct 15, 2022
1 parent 6273088 commit 81f5f19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion VariableAnalysis/Lib/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81f5f19

Please sign in to comment.