swoole/ide-helper
Fully documented IDE stub files for the Swoole PHP extension, giving PhpStorm and VS Code accurate autocompletion, parameter hints, and inline docs for every class, method, function, and constant. Install as a dev dependency and match the version to your Swoole release.
barryvdh/laravel-ide-helper of the Swoole world: tooling, not application dependency, and govern it accordingly.Swoole\ classes (one file per class), global swoole_*() functions, SWOOLE_* constants, short aliases like Co\Channel, plus src/swoole_library/ — the userland companion library loaded when swoole.enable_library is on. That last one is easy to miss in planning: developers will index and then call library classes, so they belong in your compatibility story.6.0.2 documents Swoole v6.0.2; a mismatch produces exactly the wrong kind of confidence — autocomplete suggesting methods that don't exist at runtime. Decide the policy once (pin to the extension line, bump both together) and name an owner. Note the cadence is upstream-driven, so don't commit to "always current"; commit to "within one minor of the runtime we ship."swoole step per machine. That's a documentation/onboarding deliverable, not a code one — but someone has to own it.Adopt when:
Swoole\* classes or swoole_*() functions directly, rather than only through a framework facade.vendor/ automatically.swoole.use_shortname is consistent across local, CI, and container php.ini files. If it isn't, fix the ini first — the stubs will happily autocomplete Co\Channel in an environment where it doesn't exist, papering over a real deployment inconsistency.Look elsewhere or skip when:
require-dev and never bootstrap it.For executives: One Composer command as a dev dependency, Apache-2.0, zero runtime footprint — every method body is empty and nothing is autoloaded, so it cannot affect a build, a deployment, or production behavior. The problem it removes is mundane but daily: Swoole is a C/C++ extension, so its classes, functions, and constants exist nowhere in our source, and engineers work against a red wall of "undefined class" warnings with no parameter hints. Cost is minutes per developer; benefit is faster onboarding to Swoole-based services and fewer debugging detours caused by guessed signatures. The only risks are developer-experience risks — stub/runtime version drift, and a one-time PhpStorm settings change — not operational ones. Ask: approve as a dev dependency with a named owner for version pinning. No architecture review, no ADR, no security sign-off beyond the standard dependency check.
For engineering: composer require --dev swoole/ide-helper, then pin to the installed extension line after confirming php --ri swoole | grep Version. Bump the helper whenever you bump Swoole. PhpStorm users must disable the bundled swoole stubs to avoid "multiple definitions exist" warnings. Do not require or include the stub files — with the extension loaded, redefinition fails; without it, empty bodies do nothing. Keep it out of production via composer install --no-dev.
How can I help you explore Laravel packages today?