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

Di Annotations Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  1. Is the actual target a legacy Symfony 2.x footprint, or is "Laravel" literal? These produce opposite decisions and should be resolved before any ticket is opened.
  2. What concrete pain is being solved — container boilerplate, config sprawl, or a specific injection pattern? Laravel answers the first two natively; the third needs a concrete example.
  3. If attribute-driven configuration is the goal, does Laravel 11's #[Config]/#[Context] or a ~150-line in-house attribute resolver cover it?
  4. If a legacy Symfony app is in scope, what is the budget to reach a supported version (6.4/7.x) where autowiring already exists?

Verdict: reject for adoption. The only defensible use is as a reading reference for how annotation-driven DI was historically implemented.

Integration Approach

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.

  • Laravel target: no migration exists. Evaluate in order: (1) constructor injection with interface bindings in a service provider; (2) contextual binding via when()->needs()->give(); (3) Laravel 11 attributes; (4) a thin in-house attribute resolver only if 1–3 measurably fall short.
  • Legacy Symfony target: upgrade Symfony first (2.x → 5.4 LTS → 6.4/7.x), delete this bundle as part of that upgrade, and replace with autowiring. The bundle must never become the reason an upgrade stalls.

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).

  1. Timeboxed spike (≤2 days) to document the fatal Composer conflict — it is fatal, but the evidence should be on record.
  2. One-page comparison of the underlying need against native framework capability.
  3. Decision gate: proceed only if native options demonstrably fail; otherwise close as "solved by platform."
  4. If built, encapsulate under 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.

Operational Impact

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.

  • Silent mis-injection — annotation typos or unresolved bindings yielding null/wrong collaborators rather than a clear container error.
  • Deploy-time parse failures — annotation errors surfacing during cache warm rather than in CI.
  • PHP upgrade breakage — annotation syntax and reflection behavior are PHP-version-sensitive; upgrades may fail open or fail silently.
  • Orphaned pattern — the original author leaves and nobody can confidently modify the injection layer.
  • Composer lock drift — a fork silently diverges from a package that will never release again.

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.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator