Description
Rationale
PR #2121 adds a temporary test exception for a test involving a function call to readonly()
.
Once the upstream PHPCS tokenizer supports PHP 8.2 - hopefully in PHPCS 3.8.0 -, the minimum supported PHPCS version should be raised and the exclusion should be removed.
While this may sound like a test tweak, it is in actual fact an issue with the sniff as the WP DeprecatedFunctions
sniff will currently not report on the deprecated readonly()
WP function, while it is important that it should as it will prevent plugins/themes from running into trouble when using the deprecated WP readonly()
function with future PHP versions in which the function call will likely become a fatal error, so making this change as early as possible is highly recommended.
References
- The discussion about this in PEAR/FunctionCallSignature: minor tweaks + extra test squizlabs/PHP_CodeSniffer#3667
- Fix syntax error when using readonly with dnf php/php-src#9512
Action Checklist
Once a PHPCS version is available which handles this correctly...
- Update the minimum supported PHPCS version in
composer.json
and update the README and workflows etc. - Remove the test exception from the
DeprecatedFunctions
sniff.