From 0bdf06a3e9c5f966e1a423b4c7c5b747af3a97a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 26 Aug 2026 06:43:01 +0000 Subject: [PATCH] Exclude the wp-compat false positives 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. All six errors it reported are false positives of the same kind: WordPress 6.0 and 5.3 merely formalized the already documented `...$args` and `...$arg` parameters of `apply_filters()` and `do_action()` by adding them to the function signatures, so passing extra arguments to `the_generator`, `export_term_orphaned` and the other hooks has always worked. Co-authored-by: Pascal Birchler --- phpstan.neon.dist | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 25183173..fc1450a1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -14,3 +14,21 @@ parameters: - identifier: missingType.property - identifier: missingType.parameter - identifier: missingType.return + + # johnbillion/wp-compat checks every WordPress symbol against the WordPress 4.9 + # baseline that wp-cli-tests configures, and reports anything newer. + + # WordPress 6.0 and 5.3 only formalized the already documented `...$args` and + # `...$arg` parameters of `apply_filters()` and `do_action()` by adding them to the + # function signatures. Additional arguments were collected through `func_get_args()` + # before that, so passing them has always worked. Both identifiers already name one + # specific parameter of one specific function. + - + identifier: WPCompat.parameterNotAvailable.applyfilters.args + path: src/WP_Export_Query.php + - + identifier: WPCompat.parameterNotAvailable.doaction.arg + paths: + - src/WP_Export_Returner.php + - src/WP_Export_Split_Files_Writer.php + - src/WP_Export_XML_Over_HTTP.php