Skip to content

Commit

Permalink
Out of range check
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Apr 23, 2018
1 parent b09707b commit 89484c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,10 @@ function return types. We want to keep the parenthesis map clean,
}
}

if (is_array($tokens[$x]) === false && $tokens[$x] === ':') {
if (isset($tokens[$x]) === true
&& is_array($tokens[$x]) === false
&& $tokens[$x] === ':'
) {
$allowed = [
T_STRING => T_STRING,
T_ARRAY => T_ARRAY,
Expand Down

0 comments on commit 89484c2

Please sign in to comment.