coding-standards
coding-standards copied to clipboard
Update PHPCS to support PHP 8+
This change means later versions of PHPCS 3.x can be used, rather than just 3.5. Version 3.7 is required for the sniffs to run on PHP 8.1 without triggering deprecated warnings.
In addition version 3.6 added support for PHP 8 languages features, and 3.7 added support for 8.1 language features.
WPCS and PHPUnit both need to be updated so the tests run on later PHP versions without errors. PHPUnit 7 needs to be used because the base test class in PHPCS that's used for the tests in this library doesn't support PHPUnit 8 (info here), hence the use of the --ignore-platform-reqs and --no-configuration flags when installing and running the tests on PHP 8 and 8.1.
Todo:
- [ ] Determine why the
tests/AllSniffs.phptests are performing no assertions under PHPUnit 7