You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug Squiz.Commenting.FunctionComment sniff throws ThrowsNoFullStop on one line php doc comment with @throws annotation.
Code sample
<?phpdeclare(strict_types=1);
namespaceMy;
useException;
/** @throws Exception if any other error occurs. */functionfoo(string$string): string
{
return$string;
}
To reproduce
Steps to reproduce the behavior:
Create a file called test.php with the code sample above...
Run phpcs test.php ...
See error message displayed
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
9 | ERROR | @throws tag comment must end with a full stop
| | (Squiz.Commenting.FunctionComment.ThrowsNoFullStop)
Expected behavior
No error :-)
Versions (please complete the following information):
OS: Ubuntu 18.04
PHP: 8.0
PHPCS: 3.6.1
Standard: Squiz
The text was updated successfully, but these errors were encountered:
gsherwood
changed the title
Squiz.Commenting.FunctionComment.ThrowsNoFullStop check failed when one line @throws php doc
Squiz.Commenting.FunctionComment.ThrowsNoFullStop false positive when one line @throws
Dec 20, 2021
Thanks for the report. The sniff didn't account for the whitespace after the comment, which only occurs when the comment is closed on the same line. Fixed now, and will be in 3.7.0.
Describe the bug
Squiz.Commenting.FunctionComment
sniff throwsThrowsNoFullStop
on one line php doc comment with @throws annotation.Code sample
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error :-)
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: