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.
Architecture fit. There is a fundamental mismatch that a TPM should surface before any engineering time is spent: loso/di-annotations-bundle is a Symfony 2.x bundle, not a Laravel package. It hooks into Symfony's Bundle, Extension, and CompilerPass contracts and layers doctrine/annotations parsing on top. Laravel's container (Illuminate\Container) has no equivalent extension point — it resolves via constructor reflection, explicit bindings, and contextual when()->needs()->give() rules. Nothing in this package plugs into a Laravel service provider, and there is no adapter, bridge, or community fork that does so.
What the capability actually is. The package predates Symfony's native autowiring (3.3, 2017). Its entire value proposition — annotation-declared, code-adjacent service wiring instead of XML/YAML — has since been absorbed by both ecosystems: Symfony's #[Autowire] and Laravel's constructor autowiring plus (11.x) #[Config]/#[Context]. As a product decision, this is the canonical "adopt a third-party convenience the platform later commoditized" case, and the answer was correctly no.
Integration feasibility — low. Leveraging this in a Laravel codebase would require rewriting the annotation reader and reflection layer against Illuminate\Container, plus inventing lifecycle hooks Laravel does not provide. That is not integration; it is a from-scratch reimplementation using a decade-old design as spec, competing against a first-party container that already solves ~95% of the stated problem.
Technical risk — high, concentrated in abandonment. Symfony 2.x has been EOL since 2016; the dependency constraints (PHP 5.3.3-era, symfony/symfony ~2.x, doctrine/annotations ~1.0) will not resolve on PHP 8.x. With 14 stars and 0 dependents, there is no field validation, no downstream bug reports, no security-patch channel, and no escalation path. The 0.07 score is consistent with an abandoned artifact.
Key questions for the requestor.
#[Config]/#[Context] or a ~150-line in-house attribute resolver cover it?Verdict: reject for adoption. The only defensible use is as a reading reference for how annotation-driven DI was historically implemented.
Stack fit — none for Laravel. Laravel exposes no metadata/annotation extension point comparable to Symfony's compiler passes. A port would require three new subsystems (annotation reader, reflection-to-binding layer, container lifecycle hooks) to replicate shipped framework behavior. For a TPM, the relevant comparison is cost-of-build versus cost-of-native, and native is approximately zero.
Migration path.
when()->needs()->give(); (3) Laravel 11 attributes; (4) a thin in-house attribute resolver only if 1–3 measurably fall short.Compatibility. composer require will hard-fail on any modern stack due to PHP and symfony/symfony 2.x constraints. There is no green path without forking and rewriting constraints — at which point the fork is ours to maintain in perpetuity.
Sequencing (if we proceed anyway, which we should not).
app/Support/Container/, take no third-party annotation dependency, and ship a deprecation plan on day one.Scope-control note. Annotation-based wiring tends to spread class-by-class once introduced. If any variant is approved, cap it to a named module boundary and require review sign-off on new usages.
Maintenance. Zero upstream activity. Any adoption is effectively a permanent fork: we own bug fixes, PHP-version compatibility, security review, and documentation forever, for a component with 14 stars of mindshare. Maintenance cost here is not proportional to the package's small surface area — it is proportional to the total absence of upstream.
Support. No vendor, no maintainer engagement, no community corpus (0 dependents means no issue history to search, no Stack Overflow answers). Incident resolution routes entirely to whoever performed the original port, creating a single point of failure on the team.
Scaling. Runtime cost is negligible — annotation parsing occurs at container compile time, not per request, and would be cached after boot. The real scaling risk is organizational: a bespoke annotation-DI convention no incoming Laravel developer has ever encountered. Every hire pays a ramp-up tax, and every review carries a "magic or bug?" ambiguity that constructor injection eliminates.
Failure modes.
Ramp-up. Intrinsically low complexity (annotation → reflection → bind), practically high: no Laravel documentation, no examples, no ecosystem familiarity, and an idiom that contradicts what every Laravel developer expects. Native constructor injection has near-zero ramp-up.
Roadmap position. Score 0.07, 14 stars, 0 dependents, Symfony2-only, EOL dependencies, and a value proposition fully absorbed by both Symfony's and Laravel's first-party containers. Recommend closing this evaluation as "solved by platform," redirecting the underlying request to native autowiring, and — if a gap genuinely remains — funding a small, owned, documented in-house attribute resolver instead.
The one-line ask: Approve a ≤2-day spike to confirm the Composer incompatibility and inventory any existing legacy usage, so the decision is evidence-backed rather than guessed.
How can I help you explore Laravel packages today?