Skip to content

Commit

Permalink
Merge pull request #157 from photodude/patch-2
Browse files Browse the repository at this point in the history
Spacing After Comment fails to fix error when comment is not a docblock
  • Loading branch information
wilsonge committed Feb 19, 2017
2 parents 3fc0238 + 9d8be60 commit 6387bf3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Joomla/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$phpcsFile->fixer->beginChangeset();

// Inline comments have the newline included in the content but docblock do not.
if ($tokens[$prev]['code'] === T_COMMENT)
{
$phpcsFile->fixer->replaceToken($prev, rtrim($tokens[$prev]['content']));
}

for ($i = ($prev + 1); $i <= $stackPtr; $i++)
{
if ($tokens[$i]['line'] === $tokens[$stackPtr]['line'])
Expand Down

0 comments on commit 6387bf3

Please sign in to comment.