Skip to content

Commit fed6752

Browse files
committed
Merge branch 'feature/tokenizer-php-match-minor-bugfix' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 5a63e78 + a5f9784 commit fed6752

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tokenizers/PHP.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,9 @@ protected function tokenize($string)
12901290

12911291
// Next was an open parenthesis, now check what is before the match keyword.
12921292
for ($y = ($stackPtr - 1); $y >= 0; $y--) {
1293-
if (isset(Util\Tokens::$emptyTokens[$tokens[$y][0]]) === true) {
1293+
if (is_array($tokens[$y]) === true
1294+
&& isset(Util\Tokens::$emptyTokens[$tokens[$y][0]]) === true
1295+
) {
12941296
continue;
12951297
}
12961298

0 commit comments

Comments
 (0)