- What is kutny/autowiring-bundle used for?
- It is a Symfony bundle that adds reflection-based autowiring to the Symfony2 Dependency Injection container. It integrates kutny/autowiring through compiler passes so services, controllers, and commands can receive typed constructor dependencies without verbose service definitions. It targets Symfony applications, not Laravel.
- Is kutny/autowiring-bundle compatible with Laravel?
- No. The package depends on Symfony's Bundle and DependencyInjection components and hooks into compiler passes, which Laravel does not use. Illuminate\Container is a separate PSR-11 implementation with its own reflection-based resolution. A composer require in a standard Laravel app will fail on platform constraints before any code-level incompatibility appears.
- How do I install kutny/autowiring-bundle in a Laravel project?
- You should not install it in a Laravel project. There is no Laravel service provider, no extra.laravel manifest, and no PSR-11 interoperability, so Laravel's package discovery cannot register it. If you are investigating a transitive dependency, the correct action is removal or replacing the parent package, not installation.
- Does Laravel already support autowiring for controllers and commands?
- Yes. Laravel has automatically resolved typed constructor dependencies since 5.x, including controllers, commands, jobs, and other container-resolved classes. You only need to bind interfaces or abstract classes in a service provider when the concrete implementation is not inferable. Contextual binding handles cases where different consumers need different implementations.
- Which PHP and Laravel versions does kutny/autowiring-bundle support?
- It supports neither modern Laravel nor modern PHP. The last release was 2016-02-10 with PHP 5.x/7.0-era constraints, so it will not satisfy a Laravel 10 or 11 platform requirement without a fork. It also predates PSR-11, which was ratified in 2018.
- How should I test dependency injection in Laravel without kutny/autowiring-bundle?
- Use Laravel's container and test doubles directly: bind interfaces in a service provider and swap implementations with the container's instance method or mocks in feature tests. Because Laravel resolves typed constructor dependencies natively, you can resolve classes without a custom autowiring bundle. Testing container behavior is unnecessary unless you have custom bindings or contextual resolution.
- How does kutny/autowiring-bundle compare with Laravel's service container?
- The bundle adds autowiring to Symfony's container via compiler passes, while Laravel's container resolves typed dependencies natively at runtime. Laravel also provides service providers, contextual binding, and interface binding for explicit wiring. For Laravel, the built-in container covers the bundle's core use case without extra dependencies.
- Is kutny/autowiring-bundle maintained and safe for production?
- No. Upstream is archived, the last release was in 2016, and there is no security response path, CVE monitoring, or patch release process. It has about 12 stars and zero dependents, so there is no community maintenance to inherit. Abandoned packages also carry supply-chain risk from name-squatting and unmaintained forks.
- What are the best alternatives to kutny/autowiring-bundle for Laravel?
- For Laravel, use the framework's built-in container with typed constructor injection, service provider bindings, and contextual binding. If you need explicit wiring for varied implementations, bind interfaces in a service provider rather than adding a third-party autowiring layer. For framework-agnostic PHP, PHP-DI is maintained and PSR-11 compliant.
- What should I do if kutny/autowiring-bundle appears in my composer.lock?
- Treat it as a removal task. Identify the parent package that requires it, pin or replace that parent, and remove the abandoned dependency. Then record the decision in an ADR so the same request does not recur. Confirm the underlying need in a short conversation, since Laravel's container likely already solves it.