Permalink
Browse files

Merge branch 'whitespace-comments-bugfix' of https://github.com/erikw…

  • Loading branch information...
2 parents b63ca2e + 0e27956 commit f93ca066ea7aff9bc4e4854837e834d89e14f2c2 @gsherwood gsherwood committed May 21, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 CodeSniffer/Standards/AbstractPatternSniff.php
@@ -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--;

0 comments on commit f93ca06

Please sign in to comment.