Skip to content

Commit

Permalink
Only check for WS after operator when RValue exists
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Dec 7, 2016
1 parent 893700d commit 0bb65bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function sniff(array $tokens, File $file, LinterConfiguration $configurat
// Scan forward until we find the actual operator
for ($j = 0; $j < $count && !self::isOperator($tokensInLine[$j]); $j ++);

if (isset($tokensInLine[$j + 1]) && self::isBinaryOperator($tokensInLine[$j])) {
if (isset($tokensInLine[$j + 1]) && isset($tokensInLine[$j + 2]) && self::isBinaryOperator($tokensInLine[$j])) {
if (!self::isWhitespace($tokensInLine[$j + 1])) {
$file->addWarning(new Warning(
$tokensInLine[$j]->getLine(),
Expand Down

0 comments on commit 0bb65bd

Please sign in to comment.