inpsyde / php-coding-standards

Style guide for writing consistent PHP for WordPress projects.
MIT License
98 stars 23 forks source link

Take in consideration to update the WordPress coding standards #21

Closed widoz closed 4 years ago

widoz commented 5 years ago

Inpsyde phpcs currently require WordPress coding standards version ^0.14. The current latest version of the wpcs is 1.1.0.

gmazzap commented 5 years ago

Yes, we need to more forward, and this must be done before we gan get to v1 of the standards.

The change of WPCS will requires changes to code comments like phpcs:disable because WPCS 1.0+ chnaged the version of their sniffs.

So even if in theory we could do breaking changes in 0. version without breaking semver, I really would like to avoid to switch to WPCS 1. on the 0.* series of Inpsyde styles.

websupporter commented 4 years ago

Another reason to move is now PHP7.4

With PHP 7.4 the checks can't be properly executed because $last can be null here, which results in those error messages:

 1 | ERROR | An error occurred during processing; checking has been
   |       | aborted. The error message was: Trying to access array
   |       | offset on value of type null in
   |       | /tmp/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php
   |       | on line 1375 (Internal.Exception)

If we would require ^2.2.1 this problem would be solved, see here.

gmazzap commented 4 years ago

Done in 52edc0b