From 2ada505a85978905949dc8a2fb26925c660de71a Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Tue, 6 Oct 2026 20:54:16 +0200 Subject: [PATCH] Update PHPStan to 2.3 PHPStan 2.3 reports class_exists() on the WordPress AI Client SDK classes as always false, because they have no stubs. The probes run at runtime, where the classes may exist, so the check is ignored for those two files only, next to the config's existing ignores for the same SDK. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Filip Ilic --- composer.lock | 8 ++++---- phpstan.neon.dist | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 91964fe..ba4f03b 100644 --- a/composer.lock +++ b/composer.lock @@ -960,11 +960,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.1", + "version": "2.3.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dea9c8f2d25cc849391042b71e429c1a4bf82660", - "reference": "dea9c8f2d25cc849391042b71e429c1a4bf82660", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "reference": "b1f9890d9af53a25c58129e78f0aadd31f90d7f4", "shasum": "" }, "require": { @@ -1020,7 +1020,7 @@ "type": "github" } ], - "time": "2026-05-28T14:44:12+00:00" + "time": "2026-10-06T06:15:36+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4fcb690..0a0b64b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -37,6 +37,12 @@ parameters: - identifier: deadCode.unreachable - identifier: argument.unresolvableType - identifier: method.unresolvableReturnType + # PHPStan 2.3+ also reports class_exists() on those unknown SDK classes as + # always false. The probes run at runtime, where the classes may exist. + - identifier: function.impossibleType + paths: + - ./src/Capture/class-chaining-transporter.php + - ./src/Capture/class-result-capturer.php # --- The WordPress 7.0 AI Client + bundled php-ai-client SDK have no # PHPStan stubs yet; all access is runtime-guarded. ---