Skip to content

Commit

Permalink
Squiz.Formatting.OperatorBracket reporting false positive for exit st…
Browse files Browse the repository at this point in the history
…atements (ref #3099)
  • Loading branch information
gsherwood committed Sep 13, 2020
1 parent 2f844c3 commit fad249a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public function process(File $phpcsFile, $stackPtr)
T_OPEN_CURLY_BRACKET => true,
T_OPEN_SHORT_ARRAY => true,
T_CASE => true,
T_EXIT => true,
];

if (isset($invalidTokens[$tokens[$previousToken]['code']]) === true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,5 @@ $test = (1 * static::TEST);
$test = myfunc(1 * static::TEST);

$errorPos = $params[$x]?->getLine() + $commentStart;

exit -1;
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,5 @@ $test = (1 * static::TEST);
$test = myfunc(1 * static::TEST);

$errorPos = ($params[$x]?->getLine() + $commentStart);

exit -1;

0 comments on commit fad249a

Please sign in to comment.