Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ide Helper Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: conditional, and deliberately narrow. swoole/ide-helper is not a library in any architectural sense — it is a set of PHP stub files describing an extension implemented in C/C++, with no autoloading, no executable logic, and no runtime footprint. Its fit is entirely determined by one binary question: does any environment in our stack actually execute under Swoole? That means a Swoole HTTP/WebSocket server, coroutine workers, Hyperf, or Laravel Octane running the Swoole driver. On a conventional Laravel deployment (PHP-FPM, RoadRunner, or FrankenPHP), the correct TPM decision is to decline the package outright — it would add a dependency for zero benefit. Where Swoole is present, the fit is clean and the package is effectively mandatory tooling: without it, the IDE cannot see the extension's classes at all, so every Swoole\* or Co\* reference is an "undefined class" warning and every method call is untyped and unhinted.

Integration feasibility: very high, with near-zero cost. One composer command as a dev dependency; no service provider, no config publish, no bootstrap change, no CI modification, no container change. PhpStorm and VS Code with Intelephense index vendor/ automatically and immediately surface completion, parameter names, native type declarations, and inline PHPDoc. The only substantive work items are (a) aligning the stub release with the installed extension version and (b) one manual IDE setting per workstation. This should be governed as developer tooling — the same category as barryvdh/laravel-ide-helper — not routed through architecture review. Apache-2.0, zero executable code, so the dependency review is a formality.

Technical risk: low, and almost exclusively developer-experience risk. The package cannot break a build, a test run, or a deployment, because nothing loads it. That is the important framing for stakeholders: the downside is wasted engineering time, not production incident. Three risks are worth tracking:

  1. Stub/runtime version drift. Releases mirror Swoole releases exactly (6.0.2 of this package documents Swoole v6.0.2). A mismatched pair means the IDE suggests methods that don't exist at runtime, or hides ones that do — precisely the class of bug that costs an afternoon in a debugger and, worse, erodes trust in tooling. Mitigation is procedural, not technical: pin the helper to the extension's version line and bump both together.
  2. swoole.use_shortname divergence. The stubs advertise short aliases such as Co\Channel, but those only exist when swoole.use_shortname is On, and that directive can only be set in php.ini, never at runtime. Code that autocompletes cleanly locally can therefore fail in a container whose php.ini differs. This is the most likely source of real friction and the one to test explicitly in a dev container.
  3. PhpStorm's bundled stubs. PhpStorm ships its own less complete Swoole stubs; leaving them enabled produces "multiple definitions exist" warnings and a degraded, confusing experience. Fixing it is a manual per-workstation step (Settings → PHP → Stubs → deselect swoole) that will not be done consistently without documentation. Related: the stubs must not be added to PHPStan/Psalm scanFiles paths, or static analysis will see duplicate class definitions.

Key questions before adoption:

  • Does php --ri swoole succeed in our dev environment, and what version does it report? (This single check is the gate.)
  • Is Swoole in production, or only in an evaluated/experimental Octane configuration? If the latter, defer.
  • Do we pin swoole.use_shortname in dev containers, and does our codebase use Co\ shortnames or fully qualified Swoole\ names?
  • Is the team standardized on PhpStorm, VS Code/Intelephense, or a mix? The PhpStorm stub-conflict step only applies to one cohort.
  • Who owns the "bump stubs when we bump Swoole" chore, and is it in the upgrade runbook?
  • Does our static analysis config need updating to include or explicitly exclude these stubs?

Integration Approach

Stack fit: binary and easy to screen. Add the package only to applications whose runtime is Swoole-backed. For a Laravel + Octane-on-Swoole service, this is a clear yes. For a standard FPM service in the same monorepo, adding it centrally is harmless but noise — scope it per-application rather than to a shared root, so the dependency graph stays honest. Note the package is not Laravel-aware and needs no Laravel integration; it is a pure editor aid.

Migration path: additive, reversible, one commit. composer require --dev swoole/ide-helper:~X.Y.Z, matching the extension line reported by php --ri swoole. There is no migration in the conventional sense — nothing to backfill, no runtime surface to cut over, no data or config touched. Rollback is composer remove --dev swoole/ide-helper plus re-enabling PhpStorm's bundled stubs, which makes this a genuinely low-consequence decision. Do not commit the stubs, do not require them from composer.json autoload, and do not include them anywhere.

Compatibility: versioned lockstep, otherwise unconstrained. The package has essentially no PHP-version or framework constraints of its own; the only compatibility contract that matters is stub-version-to-extension-version. Verify that the chosen release exists on Packagist for the extension line in use — older lines such as 4.8.x and 5.x are published alongside 6.x, so long-lived services on 5.1 are covered. The @dev branch exists for unreleased stubs but should not be used in a team setting; unstable stubs are a self-inflicted drift risk.

Sequencing:

  1. Confirm Swoole presence and version in the dev container (the gate).
  2. Add the pinned dev dependency to the affected application(s) only.
  3. Configure IDEs — disable PhpStorm's bundled swoole stubs; confirm Intelephense indexes vendor/ for VS Code users.
  4. Validate the shortname assumption by exercising a Co\ alias in a dev container with the production php.ini.
  5. Document the onboarding step and add "bump ide-helper with Swoole" to the extension upgrade checklist.
  6. Re-evaluate only if the Octane driver changes (e.g. a move to FrankenPHP or RoadRunner would make the package dead weight).

Operational Impact

Maintenance: trivial, but not zero — the chore is version coupling. No runtime upgrade surface, no CVE exposure of consequence (no executable code), no config drift. The recurring cost is one line in a runbook: when Swoole is upgraded, the helper is upgraded in the same change. Skip it and you get silent staleness rather than an error, which is why it must be an explicit checklist item rather than an assumption. Upstream cadence is healthy — releases track Swoole point releases closely, and the package is published by the Swoole organization itself, so abandonment risk is low and, critically, the fallback is benign: PhpStorm's bundled stubs still work, just less completely.

Support: no first-line burden, small second-line burden. No production support implications whatsoever. The realistic support tickets are "my autocomplete is wrong" and "PhpStorm says multiple definitions exist," both resolved by a documented FAQ. Assign ownership to the platform/developer-experience owner rather than an application team, since the fix is environmental.

Scaling: value scales with headcount, cost does not. The package costs nothing at runtime and nothing in infrastructure terms — it never reaches production containers. Its benefit compounds with team size and onboarding rate: every new engineer writing Swoole code hits the "undefined class" wall on day one without it. The offsetting factor is per-workstation setup, which scales linearly and is the main argument for documenting it in the onboarding guide rather than handling it ad hoc.

Failure modes, ranked:

  1. Silent version mismatch — IDE suggests nonexistent methods; no error, no signal. Highest likelihood, highest time cost.
  2. Shortname divergence between local and container php.ini — code compiles in the editor, fails at runtime in a way that looks like a Swoole bug rather than a config bug.
  3. PhpStorm stub conflict left unresolved — noisy duplicated-definition warnings that cause engineers to distrust or disable the tooling entirely.
  4. Stubs swept into static analysis — duplicate class definition errors in PHPStan/Psalm, misdiagnosed as a package defect.
  5. Production leakage — near-impossible if installed with --dev, and harmless if it did leak since nothing autoloads; not worth mitigations beyond standard --no-dev discipline.

Ramp-up: roughly 15 minutes per engineer, once. Composer install, one IDE settings toggle for PhpStorm users, done. Budget half a day total for the rollout including documentation, plus a short note in the onboarding checklist. The only genuine prerequisite is the Swoole-presence check — get that answer first, because on a non-Swoole stack the entire assessment collapses to "do not adopt."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mydnic/volet-feature-board-filament-plugin
wmde/email-address
refinery29/test-util
dees040/laravel-api-responses
teamzac/geocoder
ideatica/config-writer
keaton-php/pipe-dream
jacksonwebservices/laravel-user-suite
maksimru/conditional-laravel-debugbar
gismatul/nova-support-chat
gismatul/laravel-support-chat
networkrailbusinesssystems/oracle-api
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
refinery29/php-cs-fixer-config
parsnick/steak