loso/di-annotations-bundle
A Symfony bundle for annotation-based dependency injection: configure services and inject dependencies directly in class annotations instead of XML or YAML. Helps keep service wiring concise and close to the code it configures.
#[Autowire]). The PM lesson: when evaluating a convenience layer, ask whether the upstream platform roadmap will commoditize it — and if so, price in its eventual obsolescence from day one rather than treating it as a durable dependency.loso/di-annotations-bundle appears in a dependency audit, that is a strong signal the service is pinned to Symfony 2.x and PHP 5.x. That single datapoint should trigger a migration epic, a support-cost estimate, and a freeze on new feature investment in that service until the DI layer is normalized. Use it as a triage marker, not as a component to fix.Illuminate\Container. Any Laravel team evaluating it should close the ticket as "solved by platform": Laravel's constructor autowiring, contextual binding (when()->needs()->give()), and (11.x+) #[Config]/#[Context] attributes already cover the stated need. The PM decision is to redirect the underlying request, not to source a replacement package.doctrine/annotations deprecated ecosystem-wide. This belongs in the "unmaintained transitive dependency" bucket with an owner, a severity, and a remediation date — not in a scoping conversation about new work.Consider it only if all of the following are true:
Look elsewhere — specifically, do not adopt — when:
debug:container, lint:container).CompilerPass. Bolting this on would mean porting three subsystems (annotation reader, reflection layer writing into Illuminate\Container bindings, and lifecycle hooks Laravel doesn't provide) to replicate functionality the framework ships.symfony/symfony ~2.x pin, PHP 5.3-era constraints, and doctrine/annotations ~1.0 will hard-fail against a PHP 8.2/8.3 project. The only way to a green composer require is a fork whose constraints we own in perpetuity.For executives. This is a small, unmaintained Symfony 2-era convenience library that let developers declare dependency injection via code annotations instead of XML/YAML config files. It has negligible adoption (14 stars, zero dependent packages), targets a framework version that went end-of-life in 2016, and depends on doctrine/annotations, which the PHP ecosystem has since replaced with native attributes. Modern Symfony and Laravel both ship this capability first-party, with better tooling and debuggability. Recommendation: no new investment. Treat it as a legacy marker — if it shows up in an audit, that is the trigger to schedule modernization of the dependent service, not to evaluate the package. The one-line ask: approve a small discovery ticket to inventory where annotation-based DI is used, so we can size the migration rather than guess at it.
For engineering. Do not add this to new work, and do not attempt a Laravel port. Symfony autowiring and PHP attributes supersede it and give you IDE support, static analysis, and a container you can dump and lint. Where it already exists in a legacy Symfony 2.x app, quarantine it: pin the version, document the affected classes, and fold its removal into the next framework-upgrade window (2.x → 5.4 LTS → 6.4/7.x) rather than a standalone refactor — the bundle should never be the reason an upgrade stalls. Expect removal to be low-effort per class but broad in surface area, since annotation wiring tends to spread across controllers and services. Two operational cautions if we do touch it: annotation parse errors can surface at cache-warm/deploy rather than in tests (exercise the reader in CI), and the mechanism is PHP-version-sensitive — an upgrade may fail open with silent mis-injection rather than a clear container error. Close the evaluation as "solved by platform" and redirect the underlying request to native autowiring; if the team genuinely needs attribute-style configuration beyond what the framework provides, scope a small in-house resolver in app/Support/Container/ that we can own, document, and deprecate on our own terms.
How can I help you explore Laravel packages today?