Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-add fullstop to @throws if rule is used #3455

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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
Expand Down
Expand Up @@ -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)
{
Expand Down