diff --git a/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php index a23032e280..fea613476e 100644 --- a/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ b/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -255,7 +255,11 @@ protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) $lastChar = substr($comment, -1); if ($lastChar !== '.') { $error = '@throws tag comment must end with a full stop'; - $phpcsFile->addError($error, ($tag + 2), 'ThrowsNoFullStop'); + $fix = $phpcsFile->addFixableError($error, ($tag + 2), 'ThrowsNoFullStop'); + + if ($fix === true) { + $phpcsFile->fixer->replaceToken(($tag + 2), $tokens[($tag + 2)]['content'].'.'); + } } }//end if }//end foreach diff --git a/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed index b46df26b54..39f6e6ac6b 100644 --- a/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed +++ b/src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -196,7 +196,7 @@ public function noReturnOutsideClass() * @see * @return void * @extra Invalid tag - * @throws UnknownException unknown + * @throws UnknownException unknown. */ public function missingTwoParamComment($one, $two, $three) {