rickysu/di-extra-bundle
A Symfony bundle that adds annotation-based dependency injection configuration, letting you declare services, parameters, and injections directly in PHP classes instead of XML or YAML files.
Architecture fit — category mismatch, not a version mismatch. The cataloguing says "Laravel/PHP package," but rickysu/di-extra-bundle is a Symfony 4 bundle (RSDiExtraBundle). Bundles are discovered and compiled by Symfony's Kernel and ContainerBuilder compiler-pass pipeline. Laravel has no bundle loader, no compiler passes, and no equivalent extension point. Nothing in this package executes inside a Laravel request lifecycle. This is the decisive fact and it should be recorded before any spike is funded.
Integration feasibility — blocked on two independent fronts. First, mechanism: consuming this in Laravel is a from-scratch rewrite as an Illuminate\Support\ServiceProvider, not an install. Second, dependencies: a Symfony 4 bundle pins symfony/* to ^4.x (and likely PHP ^7.1), while Laravel 10/11 ship Symfony 6/7 components. Composer resolution will fail, and forcing it (--ignore-platform-reqs, replace) corrupts the framework's own dependency tree. That's a stop, not a configuration exercise.
Technical risk — high, and mostly adoption risk rather than code risk. Seven stars, zero dependents, single maintainer, composite score 0.125, and a target runtime (Symfony 4.4) that reached EOL in November 2022. Zero dependents means no third party has validated the code against real workloads, filed bugs, or produced hireable tribal knowledge. The code almost certainly predates PHP 8's removal of ReflectionParameter::getClass() and the tightening of container compilation APIs, so PHP 8.2/8.3 would require source patches. MIT is the one clean positive: fork-and-patch is legally unencumbered if we ever chose to own it.
Key questions (gate before spending any engineering time):
autowire/autoconfigure sugar? The README and DependencyInjection/ compiler passes must be read to answer this; the description alone is insufficient.#[Autowire], #[TaggedIterator], #[AsDecorator], service decoration) that superseded these features by 5.3+? If yes, the package is superseded even within its own ecosystem.Verdict: Recommend reject — category mismatch and abandoned upstream. Optionally timebox a one-day read of the source purely as a pattern catalog for improving our own provider ergonomics. Do not sequence an integration.
Stack fit — none for Laravel. There is nothing to sequence into an install plan. The productive framing for engineering is: "other ecosystems solved DI ergonomics problems; here is how we solve them natively in Illuminate\Container." If a spike extracts the bundle's feature set, each item should land on a Laravel-native equivalent rather than a port:
| Bundle concept (inferred) | Laravel-native equivalent |
|---|---|
| Auto-registration by interface/namespace | config/app.php providers + composer.json extra.laravel.providers; make:provider |
| Conditional / contextual injection | #[ContextualAttribute] (L11+), $this->app->when(...)->needs(...)->give(...) |
| Service decoration | $this->app->extend(Service::class, fn ($svc, $app) => ...) |
| Tagged service collection | $this->app->tag([...], 'tag') + tagged(); #[Tag] attributes |
| Lazy / proxy services | Deferred providers + constructor injection discipline |
| Interface binding conventions | #[Bind] / #[Singleton] attributes, or a small internal provider base class |
Migration path — there is nothing to migrate from. If a legacy Symfony 4 service surfaces in the estate, the path is: freeze the service, extract its compiler-pass logic into explicit PHP, and rewrite bootstrapping onto Symfony 5.4/6.4 before anything else. Do not introduce this bundle as a compatibility shim; that converts an existing EOL problem into an EOL problem plus an owned dependency.
Compatibility work required even for a read-only spike: PHP 7.4 + Symfony 4.4 in an isolated container. Do not add it to any application composer.json, and do not add it to any shared CI image.
Sequencing (recommended):
Resources/config/, the extension class, and compiler passes; enumerate features and mark which are now first-party Symfony.Maintenance — would be total ownership. Abandonment means inheriting security patching, PHP 8+ compatibility fixes, Symfony constraint loosening, and test coverage, with no upstream triage to piggyback on. Estimate 2–5 engineer-days of initial remediation plus a recurring tax every PHP or Symfony major cycle — for a capability the framework already ships.
Support — effectively zero. No maintainer SLA, no community forum, no Stack Overflow corpus, no AI-assistant coverage. When a container compile fails at 2 a.m., on-call debugs unfamiliar compiler-pass code with no searchable precedent. We would become the world's leading experts on this package by default, which is not a position worth holding.
Scaling — the constraint is team scale, not throughput. A DI container compiles at boot and caches; runtime performance is a non-issue. The real cost is cognitive: bespoke DI conventions create invisible autowiring that produces wrong-service-resolved bugs far from their cause and lengthens onboarding for every new hire. Standard Laravel idioms are hireable and documented; this is neither.
Failure modes to document:
composer install resolution failure when Symfony 4 pins meet Laravel's Symfony 6/7 components — blocks every build, not just the feature.Ramp-up — negative ROI. Reading the bundle is cheap; the knowledge is non-transferable and expires with the framework. Every hour spent on a Symfony-4-era DI dialect is an hour not spent on container idioms the team uses across the portfolio. A mid-level Laravel engineer is productive with contextual binding and tag attributes in under an hour precisely because documentation, community answers, and assistant coverage all exist.
Bottom line for portfolio review: 0.125 with 7 stars and 0 dependents is an accurate signal, and the Symfony-bundle/Laravel-stack mismatch makes this a clean reject rather than a conditional one. Recommended action: a one-paragraph ADR closing the question, and — if DI verbosity is a genuine pain point — a small internal spike on native provider ergonomics funded from the same budget.
How can I help you explore Laravel packages today?