diff --git a/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php b/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php index 45bcdbdef6..afc7ac071a 100644 --- a/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php +++ b/src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php @@ -110,7 +110,7 @@ public function process(File $phpcsFile, $stackPtr) } else { $fix = $phpcsFile->addFixableError('Expected %s', $closingBracket, 'Missing', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment.$phpcsFile->eolChar); + $phpcsFile->fixer->replaceToken($closingBracket, '}'.$comment); } } diff --git a/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc.fixed b/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc.fixed index 3288305c50..4515c41a4b 100644 --- a/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/Commenting/ClosingDeclarationCommentUnitTest.inc.fixed @@ -58,17 +58,14 @@ class TestClass { }//end class - abstract class TestClass { }//end class - interface TestClass { }//end interface - class MyClass { public function myFunction(); @@ -84,6 +81,5 @@ class TestClass enum MissingClosingComment { }//end enum - enum HasClosingComment { }//end enum