Skip to content

Commit

Permalink
Merge branch 'whitespace-comments-bugfix' of https://github.com/erikw…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 21, 2013
2 parents b63ca2e + 0e27956 commit f93ca06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CodeSniffer/Standards/AbstractPatternSniff.php
Expand Up @@ -409,7 +409,9 @@ protected function processPattern(
// This may just be an indent that comes after a newline
// so check the token before to make sure. If it is a newline, we
// can ignore the error here.
if ($tokens[($stackPtr - 1)]['content'] !== $phpcsFile->eolChar) {
if (($tokens[($stackPtr - 1)]['content'] !== $phpcsFile->eolChar)
&& ($this->ignoreComments === true && in_array($tokens[($stackPtr - 1)]['code'], PHP_CodeSniffer_Tokens::$commentTokens) === false)
) {
$hasError = true;
} else {
$stackPtr--;
Expand Down

0 comments on commit f93ca06

Please sign in to comment.