maba/dependency-injection-extra
Extra compiler passes for Symfony Dependency Injection that register tagged services into a registry or other service, optionally passing tag attributes, service IDs, or priority-based ordering. Deprecated; use paysera/lib-dependency-injection instead.
Architecture fit
symfony/dependency-injection: it ships CompilerPassInterface implementations (documented: AddTaggedCompilerPass) that wire tagged services into a registry via a method call, optionally forwarding tag attributes.Bundle::build(), ContainerBuilder::addCompilerPass(), container dump/cache warmup. Laravel uses Illuminate\Container as its runtime container and does not compile a Symfony ContainerBuilder. This component is therefore not in the Laravel request/DI path at all.$this->app->tag([...], 'my_provider') plus $this->app->tagged('my_provider'), which returns a lazy RewindableGenerator over the tagged bindings. Priority ordering and attribute-style metadata can be layered on with a few lines of registry code or contextual binding. The package solves a problem Laravel has already solved.Integration feasibility
symfony/dependency-injection instance already exists in the tree; near-zero code surface, MIT license, no service providers, no config, no runtime hooks.paysera/lib-dependency-injection as a superset. Adopting a library that its own author has superseded is a decision that must be justified with a specific reason, not convenience.Technical risk
replace; the compiler-pass API itself has been stable, so the fix is usually constraint surgery plus a test run — but that is unowned work.Key questions
symfony/dependency-injection ContainerBuilder in the target application, or is this being evaluated for a Laravel app that has none?app->tagged() closes it and the evaluation ends.paysera/lib-dependency-injection being considered in the same evaluation, and why not — it is the author's stated successor with more features?paysera/lib cover it?Stack fit
Illuminate\Container tagging ($this->app->tag, $this->app->tagged) inside a service provider; implement ordering with a small Registry class that sorts by priority. This keeps one container, one mental model, and a maintained dependency.ContainerBuilder is confined to the library's composition root and does not leak into framework bootstrap._instanceof autoconfiguration plus a small compiler pass, or paysera/lib-dependency-injection.Migration path
addProvider(ProviderInterface, string $name, string $theme)) into our own interface first, so both the compiler pass and a Laravel tagging implementation can satisfy it.paysera/lib-dependency-injection if still on Symfony DI, or (b) replace the compiler pass with a service provider using tagged(). Both are contained changes if the registry contract is stable.paysera/lib-dependency-injection — the deprecation notice is an explicit, unambiguous signal. Do not onboard a 2020 package with zero dependents.maba/dependency-injection-extra internally is a valid escape hatch for legacy Symfony 4/5 apps, but treat it as a freeze, not a foundation: widen constraints, add PHP 8 CI, tag an internal version, and record it on the deprecation watchlist.Compatibility
AddTaggedCompilerPass) — do not assume additional passes exist.container:cache:clear, and confirm tagged services defined in other bundles are visible at compile time.Sequencing
ContainerBuilder exists in the target system. If no → close evaluation, implement native Laravel tagging.paysera/lib-dependency-injection first as the primary candidate; treat this package as the fallback only if the successor is also unusable.Maintenance
Support
Scaling
Failure modes
Ramp-up
paysera/lib-dependency-injection and document the exception.How can I help you explore Laravel packages today?