-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Problem with AjaxNullComparisionSniff #2614
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
Comments
Yup. This is a known issue and was fixed in #2456, but that PR will not get merged.... |
I'm really surprised you are using this sniff - it's a project-specific sniff that I will delete in version 4 (and should have deleted a long time ago). Is this sniff actually providing value to you? |
Well, it was part of our company's ruleset long before i started working here. So as for this issue instance. I'm quite settled, so its up to you whether you want to close this issue or keep it open for whatever reason... Thanks anyway for quick replies and explanations. |
I'm going to close this as I don't think looking into this sniff is a good use of time. I think you've made the right decision to remove it, but please let me know if you discover that it was bringing some value. |
version: at least 3.4.2 up to current master
In the following snippet, warning is triggered
Reason for this is that method y() has parameter but does not have doc comment and the method above (the method x()) has a doc comment with
@api
annotation.This causes the sniff to believe that the method y() is an api method, although actualy x() is.
You can see in the sniff it just searches for the previous doc comment, which does not necesarily belong to the method in question:
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php#L56
Putting even an empty doc comment above the methody y() makes the warning go away.
The text was updated successfully, but these errors were encountered: