consistence / coding-standard

Consistence - Coding Standard - PHP Code Sniffer rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SlevomatCodingStandard.ControlStructures.YodaComparison is removed

oojacoboo opened this issue · comments

The ruleset SlevomatCodingStandard.ControlStructures.YodaComparison has been removed. Please update the ruleset as this breaks phpcs, at least within the vscode plugin currently.

It appears this sniff has been updated to DisallowYodaComparisonSniff.

Yes, this was already addressed long time ago: 2bafec2.

But I am not sure if your phpcs setup is correct, since as you can see, due to the version constraints you should have never been able to install Slevomat CS 4.0 alongside an incompatible version of Consistence CS.

I have the following in my composer.json

"slevomat/coding-standard": "~4.6",
"consistence/coding-standard": "~3.4",

That is pretty weird, are you sure, there is no other CS ruleset, where an old version of Yoda sniff might be included? Can you verify that the Consistence's ruleset contains the changed rule on your disk? (should be at vendor/consistence/coding-standard/Consistence/ruleset.xml).

And how do you run your phpcs (which cmd args)?

Looks like the issue was within some other repos within my IDE project. So, after composer updating each repo, the ruleset disappeared. Sorry for the false alarm.