From 71746892ba4d9e87ff70d0d09f5ac056127d2ab1 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 26 Aug 2026 07:56:12 +0000 Subject: [PATCH] Exclude the wp-compat false positive from the PHPStan config The johnbillion/wp-compat extension that comes with wp-cli-tests checks every WordPress symbol against the WordPress 4.9 baseline that wp-cli-tests configures. It reported a single error, and it is a false positive: WordPress 5.3 merely formalized the already documented `...$arg` parameter of `do_action()` by adding it to the function signature, so passing the server instance to `rest_api_init` has always worked. Co-authored-by: Pascal Birchler --- phpstan.neon.dist | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8168aa3..1fee9bf 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,3 +9,15 @@ parameters: - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php - vendor/wp-cli/mustangostang-spyc/src/Spyc.php treatPhpDocTypesAsCertain: false + ignoreErrors: + # johnbillion/wp-compat checks every WordPress symbol against the WordPress 4.9 + # baseline that wp-cli-tests configures, and reports anything newer. + + # WordPress 5.3 only formalized the already documented `...$arg` parameter of + # `do_action()` by adding it to the function signature. Additional arguments were + # collected through `func_get_args()` before that, so passing the server instance to + # `rest_api_init` has always worked. The identifier already names one specific + # parameter of one specific function. + - + identifier: WPCompat.parameterNotAvailable.doaction.arg + path: inc/Runner.php