Describe the bug
A method has two parameters, but in the docblock's parameters definition, only one @param has a type:
/**
* @param mixed[] $providedProperties Array with json properties
* @param $rc Reflection class to check
*/
protected function checkMissingData(array $providedProperties, ReflectionClass $rc)
I had to provide the first mixed[] type to prevent phpstan from complaining, and the type of the second parameter is already sufficiently documented in the method's signature - there is no reason to add it to the docblock again.
Still I get an error:
ERROR | [x] Tag value for @param tag indented incorrectly; expected 1 spaces but found 9 (Generic.Commenting.DocComment.TagValueIndent)
This happens with the PEAR coding standard.
Code sample
/**
* Test
*
* @param mixed[] $providedProperties Array with json properties
* @param $rc Reflection class to check
*/
protected function checkMissingData(array $providedProperties, ReflectionClass $rc)
{
}
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
FILE: /home/cweiske/dev/jsonmapper/test.php
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
6 | ERROR | [x] Tag value for @param tag indented incorrectly; expected 1 spaces but found 9
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------
Time: 14ms; Memory: 6MB
Expected behavior
Aligning @param without types to parameters with types should be allowed.
Versions (please complete the following information)
|
|
| Operating System |
Linux Debian 13 |
| PHP version |
8.4.16 |
| PHP_CodeSniffer version |
4.0.1 |
| Standard |
PEAR |
| Install type |
composer |
Please confirm
Describe the bug
A method has two parameters, but in the docblock's parameters definition, only one
@paramhas a type:I had to provide the first
mixed[]type to prevent phpstan from complaining, and the type of the second parameter is already sufficiently documented in the method's signature - there is no reason to add it to the docblock again.Still I get an error:
This happens with the PEAR coding standard.
Code sample
To reproduce
Steps to reproduce the behavior:
test.phpwith the code sample above...phpcs test.php ...Expected behavior
Aligning
@paramwithout types to parameters with types should be allowed.Versions (please complete the following information)
Please confirm
4.xbranch of PHP_CodeSniffer.