-
-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Description
Describe the bug
The Squiz.Commenting.FunctionComment
sniff truncates class name if it contains underscores.
Code sample
/**
* @return integer|WP_Error
*/
function test()
{
return 0;
}
Custom ruleset
<?xml version="1.0"?>
<ruleset name="CS">
<rule ref="Squiz.Commenting.FunctionComment"/>
</ruleset>
To reproduce
Steps to reproduce the behavior:
- Create a file called
test.php
with the code sample above - Run
phpcbf test.php
- Check out the modified code. It corrected the
integer
type toint
, but it truncated the class nameWP_Error
to justWP
:
/**
* @return int|WP
*/
function test()
{
return 0;
}
Expected behavior
The code after modification should look like:
/**
* @return int|WP_Error
*/
function test()
{
return 0;
}
Versions (please complete the following information)
Operating System | macOS 15.6 |
PHP version | 8.4.7 |
PHP_CodeSniffer version | 3.13.0 |
Standard | Squiz |
Install type | Composer |
Please confirm
- I have searched the issue list and am not opening a duplicate issue.
- I have read the Contribution Guidelines and this is not a support question.
- I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
- I have verified the issue still exists in the
master
branch of PHP_CodeSniffer.
cartpauj