yiisoft/injector
PSR-11 compatible dependency injector with autowiring. Resolves and injects dependencies when calling functions or creating objects, supports extra arguments by name or type, and handles variadic parameters. Works with any PSR-11 container.
Architecture fit remains poor for standard Laravel applications due to Laravel's Illuminate\Container, which already provides robust dependency resolution with deep framework integration (autowiring, contextual binding, factory definitions). The new release introduces no architectural or feature-level changes that address Laravel's native capabilities. Integration feasibility is still low, as the package lacks Laravel-specific integrations (e.g., automatic resolution of Request, Auth, or Eloquent models). Technical risks persist: potential conflicts in service resolution, increased debugging complexity, and minimal performance gains. The refactored Injector::invoke() (Enh #98) and PHP 8.4 closure improvements (Enh #105) are internal optimizations that do not mitigate Laravel's existing DI system. Key questions remain unchanged:
yiisoft/injector are unmet by Laravel's native capabilities?Stack fit is still suboptimal; Laravel's container is deeply embedded in its service provider system, middleware, and event handling. The new release does not introduce Laravel-specific integrations or compatibility layers. A migration path would still require overriding core framework components (e.g., Application class), which is unsupported and likely breaks functionality. Compatibility remains limited—yiisoft/injector lacks Laravel-specific features (e.g., automatic Request/Auth resolution). Sequencing issues persist: developers would still need to manually wire services across two containers, leading to inconsistent patterns. The PHP 7.4–8.5 constraint (Chg #105, #111) aligns with Laravel's supported versions but does not improve integration feasibility.
Maintenance burden remains high due to dual-container management, with no changes to mitigate resolution conflicts or debugging complexity. Support challenges persist, as Laravel's ecosystem tools (e.g., artisan tinker) won’t interact with yiisoft/injector. The refactored invoke() method (Enh #98) may slightly improve debug traces for yiisoft/injector users, but this does not address Laravel-specific failure modes (e.g., ambiguous bindings, mixed stack traces). Scaling is unaffected, but operational overhead grows with team size. Ramp-up time for new developers remains extended (2–3 weeks) due to non-standard DI patterns, with no clear ROI. The new release does not introduce breaking changes or features that alter this assessment.
How can I help you explore Laravel packages today?