Skip to content

Commit

Permalink
More null check on $token->getNextMeaningfulToken() on BlockFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 29, 2024
1 parent abd81d4 commit 0cd45ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TokenRunner/Analyzer/FixerAnalyzer/BlockFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public function findInTokensByEdge(Tokens $tokens, int $position): ?BlockInfo
// shift "array" to "(", event its position
if ($token->isGivenKind(T_ARRAY)) {
$position = $tokens->getNextMeaningfulToken($position);

if ($position === null) {
return null;
}

/** @var Token $token */
$token = $tokens[$position];
}
Expand Down

0 comments on commit 0cd45ee

Please sign in to comment.