-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FunctionComment sniff only corrects last param in list #2945
Comments
Hi @gsherwood, I noticed you changed this here: 4079d5f Is there any reason for this check of more than one? It means it only ever corrects the last param. |
The Squiz standard wants you to use If you use |
@gsherwood Is there no way to override this for PHP 7 users who want to use the short forms? The It seems a little messy to have to copy the whole Sniff and call out to a different (A similar thing seems to happen too for return types). Is there no way the sniff can suggest either short or long forms (configurable by a parameter maybe?) |
What you are suggesting, was previously included in PR #2456, but unfortunately that never got merged. |
@jrfnl Yeah I saw that PR, it's a shame it never got merged in, however that PR seems to change a lot in one, which is always harder to get in. =( I wonder if the changes needed just for this issue can be merged in without changing 299 files in the process (as good as your PR may have been for the overall structure of the project). |
That and how it would be pulled was all discussed beforehand in #2189 and this way was the preferred way.
Those changes will now go into PHPCSUtils. I will not pull any of it here again. |
In this file: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php
On lines 388-390:
This means it skips the PHP version checking below on line 404, and so it incorrectly expects
integer|float
, rather thanint|float
on PHP 7.If you flip these arguments it expects
float|int
rather thanfloat|integer
(which is correct but not consistent.)The text was updated successfully, but these errors were encountered: