Skip to content

Commit

Permalink
WP/DeprecatedFunctions: temporarily exclude one test on PHP 8.2
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrfnl committed Dec 4, 2022
1 parent eba54de commit d15462d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public function getWarningList() {
$warnings[377]
);

// Temporarily until PHPCS supports PHP 8.2.
if ( PHP_VERSION_ID >= 80200 ) {
unset( $warnings[364] ); // Function call to readonly.
}

return $warnings;
}

Expand Down

0 comments on commit d15462d

Please sign in to comment.