Skip to content

Commit d15462d

Browse files
committed
WP/DeprecatedFunctions: temporarily exclude one test on PHP 8.2
The logic in the PHP 8.2 Tokenizer needs to be adjusted to allow for PHP 8.2 Disjunctive Normal Types in combination with `readonly` properties. While PHP 8.2 still allows for the `readonly` keyword being used as a function call - see: https://3v4l.org/hL5da -, the PHPCS tokenizer has not been adjusted yet to allow for this in a way which is compatible with DNT. Also see: * The discussion about this in squizlabs/PHP_CodeSniffer 3667 * php/php-src 9512
1 parent eba54de commit d15462d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public function getWarningList() {
9696
$warnings[377]
9797
);
9898

99+
// Temporarily until PHPCS supports PHP 8.2.
100+
if ( PHP_VERSION_ID >= 80200 ) {
101+
unset( $warnings[364] ); // Function call to readonly.
102+
}
103+
99104
return $warnings;
100105
}
101106

0 commit comments

Comments
 (0)