Skip to content

Commit

Permalink
DisallowMultipleStatements didn't exclude <?=
Browse files Browse the repository at this point in the history
  • Loading branch information
nkovacs committed Sep 12, 2016
1 parent a80630e commit dd54105
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

$prev = $phpcsFile->findPrevious(array(T_SEMICOLON, T_OPEN_TAG), ($stackPtr - 1));
if ($prev === false || $tokens[$prev]['code'] === T_OPEN_TAG) {
$prev = $phpcsFile->findPrevious(array(T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO), ($stackPtr - 1));
if ($prev === false || in_array($tokens[$prev]['code'], [T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO], true) === true) {
$phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no');
return;
}
Expand Down

0 comments on commit dd54105

Please sign in to comment.