From 062abbb7a1ca885876a531f08fbf76c1a1deeda7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 26 Aug 2026 07:32:27 +0000 Subject: [PATCH 1/2] 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 6.0 merely formalized the already documented `...$args` parameter of `apply_filters()` by adding it to the function signature, so passing the extra arguments to `oembed_result` 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 25c2e56..bd9d5a5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -13,3 +13,15 @@ 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 only formalized the already documented `...$args` parameter of + # `apply_filters()` by adding it to the function signature. Additional arguments were + # collected through `func_get_args()` before that, so passing them to `oembed_result` + # has always worked. The identifier already names one specific parameter of one + # specific function. + - + identifier: WPCompat.parameterNotAvailable.applyfilters.args + path: src/Fetch_Command.php From 6a2087d48187f79500f73f1a4216be4e4b1cb21f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 26 Aug 2026 08:12:37 +0000 Subject: [PATCH 2/2] Name the correct filter in the wp-compat rationale The comment explaining the ignore referred to `oembed_result`, but the `apply_filters()` call it covers, and the one wp-compat flags, is `pre_oembed_result`. Co-authored-by: Pascal Birchler --- phpstan.neon.dist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index bd9d5a5..5d5751e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -19,9 +19,9 @@ parameters: # WordPress 6.0 only formalized the already documented `...$args` parameter of # `apply_filters()` by adding it to the function signature. Additional arguments were - # collected through `func_get_args()` before that, so passing them to `oembed_result` - # has always worked. The identifier already names one specific parameter of one - # specific function. + # collected through `func_get_args()` before that, so passing `$url` and + # `$oembed_args` to `pre_oembed_result` has always worked. The identifier already + # names one specific parameter of one specific function. - identifier: WPCompat.parameterNotAvailable.applyfilters.args path: src/Fetch_Command.php