From 977cbd41da4db00722a18bdc4ca4585f693fce85 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Jun 2026 04:58:52 +1200 Subject: [PATCH] chore(messaging): exclude Swoole coroutine polyfill from PHPStan The test polyfill declares stand-in Swoole\Coroutine and Swoole\Coroutine\Channel classes behind a runtime extension check. PHPStan ignores the guard and parsed those minimal declarations, shadowing the real swoole/ide-helper stubs and reporting false 'undefined static method' errors codebase-wide (e.g. getContext, join, create, Channel::close in app/realtime.php). Exclude the polyfill from analysis so the ide-helper stubs are used. Verified: Checks/Analyze clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- phpstan.neon | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 0b8761c19e..e28de76d2d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -12,3 +12,7 @@ parameters: - vendor/swoole/ide-helper excludePaths: - tests/resources + # Declares stand-in Swoole\Coroutine and Swoole\Coroutine\Channel classes guarded by a runtime + # extension check. PHPStan ignores that guard, so analysing this file would shadow the real Swoole + # ide-helper stubs and report false "undefined method" errors across the codebase (e.g. app/realtime.php). + - tests/unit/Messaging/SwooleCoroutinePolyfill.php