VIP-Coding-Standards icon indicating copy to clipboard operation
VIP-Coding-Standards copied to clipboard

Replace WordPress.PHP.StrictComparisons with Universal.Operators.StrictComparisons

Open rebeccahum opened this issue 4 years ago • 1 comments
trafficstars

In https://github.com/WordPress/WordPress-Coding-Standards/pull/1919, the WordPress.PHP.StrictComparisons sniff was replaced with Universal.Operators.StrictComparisons.

We currently reference it here:

https://github.com/Automattic/VIP-Coding-Standards/blob/60ad148168258afccd05ff0429d53a7e810270a5/WordPress-VIP-Go/ruleset.xml#L216-L218

rebeccahum avatar Jan 08 '21 07:01 rebeccahum

Please be aware, this change should not be made until WPCS 3.0.0 has been released or - alternatively - PHPCSExtra has become a direct dependency as otherwise the ruleset will break.

jrfnl avatar Jan 08 '21 11:01 jrfnl

Another item that'll need to be addressed with the 3.0+ migration is that the strip_quotes method is no longer included in \WordPressCS\WordPress\Sniff since https://github.com/WordPress/WordPress-Coding-Standards/pull/1926 -- which seems to be used in at least five files --

https://github.com/Automattic/VIP-Coding-Standards/search?q=strip_quotes

georgestephanis avatar Dec 15 '22 19:12 georgestephanis

@georgestephanis The intention is for VIPCS to start using PHPCSUtils, same as WPCS. A similar strip_quotes() function is available via PHPCSUtils + lots more handy utilities.

As WPCS 3.0.0 will be a major release with breaking changes, in addition to the changelog, an end-user upgrade guide + a dev upgrade guide will be made available.

jrfnl avatar Dec 15 '22 19:12 jrfnl