diff --git a/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php index 44cea34dcd..1dfbc12388 100644 --- a/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php +++ b/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php @@ -102,7 +102,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $error = 'Block comments must be ended with */'; $fix = $phpcsFile->addFixableError($error, $end, 'WrongEnd'); if ($fix === true) { - $phpcsFile->fixer->replaceToken($stackPtr, '*/'); + $phpcsFile->fixer->replaceToken($end, '*/'); } } diff --git a/CodeSniffer/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed b/CodeSniffer/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed new file mode 100644 index 0000000000..2b8bbacc50 --- /dev/null +++ b/CodeSniffer/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed @@ -0,0 +1,201 @@ +