Skip to content

Commit

Permalink
Fixed bug #554 : ScopeIndentSniff causes errors when encountering an …
Browse files Browse the repository at this point in the history
…unmatched parenthesis
  • Loading branch information
gsherwood committed Apr 17, 2015
1 parent 2501460 commit 0f06788
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
// the same level as where they were opened (but can be more).
if ($checkToken !== null
&& $tokens[$checkToken]['code'] === T_CLOSE_PARENTHESIS
&& isset($tokens[$checkToken]['parenthesis_opener']) === true
) {
if ($this->_debug === true) {
$line = $tokens[$i]['line'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,9 @@ try {
return false;
}

/*
$a = array(
*/
);

echo ""
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,9 @@ function foo()
return false;
}

/*
$a = array(
*/
);

echo ""
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,9 @@ try {
return false;
}

/*
$a = array(
*/
);

echo ""
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,9 @@ function foo()
return false;
}

/*
$a = array(
*/
);

echo ""
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc')
823 => 1,
848 => 1,
860 => 1,
861 => 1,
863 => 1,
865 => 1,
);

}//end getErrorList()
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #523 : Generic ScopeIndent errors for IF in FINALLY
- Fixed bug #527 : Closure inside IF statement is not tokenized correctly
- Fixed bug #551 : Multiple catch blocks not checked in Squiz.ControlStructures.ControlSignature sniff
- Fixed bug #554 : ScopeIndentSniff causes errors when encountering an unmatched parenthesis
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit 0f06788

Please sign in to comment.