Skip to content

Commit

Permalink
Add T_INSTANCEOF to OperatorSpacingSniff
Browse files Browse the repository at this point in the history
  • Loading branch information
grongor committed May 22, 2019
1 parent 100a81c commit d208a21
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function register()
$targets += Tokens::$assignmentTokens;
$targets[] = T_INLINE_THEN;
$targets[] = T_INLINE_ELSE;
$targets[] = T_INSTANCEOF;

return $targets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,7 @@ function bar(): array {}
if ($line{-1} === ':') {
$line = substr($line, 0, -1);
}

$a = $a instanceof $b;
$a = $a instanceof $b;
$a = ($a)instanceof$b;
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,7 @@ function bar(): array {}
if ($line{-1} === ':') {
$line = substr($line, 0, -1);
}

$a = $a instanceof $b;
$a = $a instanceof $b;
$a = ($a) instanceof $b;
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public function getErrorList($testFile='OperatorSpacingUnitTest.inc')
201 => 2,
239 => 1,
246 => 1,
265 => 2,
266 => 2,
];
break;
case 'OperatorSpacingUnitTest.js':
Expand Down

0 comments on commit d208a21

Please sign in to comment.