-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
False positive Generic.ControlStructures.DisallowYodaConditions #19
Comments
@jrfnl, I'm working on a PR to improve code coverage for There is also squizlabs/PHP_CodeSniffer#2830, which reports two false negatives. Do you prefer that they are moved here or do you prefer that a separate issue is created in this repository for false negatives? |
@rodrigoprimo When I forked the repo, I only moved my own issues/PRs over. Other people are welcome to move their issues/PRs over themselves (and then close the original). But it's also perfectly fine for the original issue to remain as-is and open. It can still be closed at a later point in time if/when the issue would be resolved via a PR in this repo. I agree that for the time being and the foreseeable future, it is a good idea to also search the Squizlabs repo for related issue if/when reviewing a sniff. As you are working on code coverage, I don't expect your PR to address these tickets. If during your work on the code coverage you would come across more false positive/negative situations, feel free to add to this ticket if it's about the same type of false positive or to open a new ticket if the situation is different enough. Does that help ? |
That helps! I was under the wrong impression that the plan was to slowly move all the issues that are still relevant from the old repository to this one. Thanks for clarifying that this is not the case.
Yes, I'm not planning to. Unfortunately, the fix for these issues doesn't seem trivial.
I already have some more false positive/negative situations that I will share in a subsequent comment once I finish the test coverage PR as I might find a few more. |
Here are two false positives that I found while working on a PR to improve code coverage for this sniff. String concatenation does not trigger an error, so I believe adding parentheses to the string closer to the operator should not trigger it as well: 'string' . ('concat') === $value; I'm a bit unsure about the one below. I believe it should not trigger an error as it is a syntax error (missing closing bracket). [1, 2 === $value; |
Repost from squizlabs/PHP_CodeSniffer#2962:
@umherirrender provided a second code sample:
@jlherren provided a third:
The text was updated successfully, but these errors were encountered: