Skip to content

Commit c76c689

Browse files
committed
Check for index before using it so we dont throw errors for missing brackets
git-svn-id: http://svn.php.net/repository/pear/packages/PHP_CodeSniffer/trunk@252285 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 205016f commit c76c689

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeSniffer/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ private static function _recurseScopeMap(&$tokens, $numTokens, $eolChar, $stackP
13731373
if (isset($tokens[$i]['parenthesis_owner']) === true) {
13741374

13751375
$owner = $tokens[$i]['parenthesis_owner'];
1376-
if (in_array($tokens[$owner]['code'], PHP_CodeSniffer_Tokens::$scopeOpeners) === true) {
1376+
if (in_array($tokens[$owner]['code'], PHP_CodeSniffer_Tokens::$scopeOpeners) === true && isset($tokens[$i]['parenthesis_closer']) === true) {
13771377
// If we get into here, then we opened a parenthesis for
13781378
// a scope (eg. an if or else if). We can just skip to
13791379
// the closing parenthesis.

0 commit comments

Comments
 (0)