theofidry/sfcontext-bundle
A Symfony bundle that integrates SfContext, giving your application a simple way to define and access shared context from services, controllers, and templates. It keeps context handling centralized and consistent across your Symfony project.
Architecture fit — poor, effectively zero. theofidry/sfcontext-bundle is a Symfony bundle, not a Laravel package. It ships a BundleInterface implementation whose boot()/build() lifecycle is driven by the Symfony kernel; Laravel's Application::bootstrapWith() never invokes it, and Composer's extra.laravel.providers auto-discovery has nothing to discover. The package's actual value proposition — static access to the dependency injection container — is already a first-class framework primitive in Laravel via the app() helper, the Facade base class, and Container::getInstance(). There is no functional gap for this package to fill on our stack, so the architecture fit is not "adaptable" but "redundant."
Integration feasibility — technically installable, practically inert. The Composer artifact will install as a plain library, but the bundle's extension configuration, compiler passes, and service definitions will never be compiled. To get anything out of it we would have to hand-instantiate its context/holder class and manually hand it our container — at which point we have written a bespoke bridge that does strictly less than the one-line app(Foo::class) we already have. That is negative ROI work.
Technical risk — high, concentrated in abandonment. Last release 2019-12-12; repository archived; 4 stars; 0 dependents. Its composer.json constraints almost certainly pin PHP ^7.x and Symfony ^3.4 || ^4.x, which collide with the PHP 8.1+/Symfony 6/7 baseline of any modern Laravel (10/11/12). Installing it will likely require --ignore-platform-reqs or a fork, both of which are governance red flags. There is no security-response channel and no CVE coverage for an archived repo. The pattern itself (static service locator) is additionally an anti-pattern: it hides constructor dependencies, defeats static analysis, and makes unit tests order-dependent.
Key questions before proceeding:
app()/facades don't already cover the use case? Every static-container use case I can construct is covered.Stack fit — mismatched at the container boundary. Laravel's container is Illuminate\Container\Container (PSR-11 compliant since 5.8), while this bundle was built against Symfony's DependencyInjection component and its service-locator idioms. Even where both satisfy PSR-11, the resolution semantics (contextual binding, tagged services, deferred providers, scoped() for Octane) differ, so a Symfony-style static grab would bypass Laravel's binding pipeline entirely.
Migration path — replace, do not port. If the driver is a Symfony application being re-platformed to Laravel, the correct move is to strip the static calls during the port and convert each one to constructor injection or, where genuinely unavoidable, a scoped facade. Carrying SfContextBundle across the boundary preserves the anti-pattern and adds an unmaintained dependency for the privilege.
Compatibility — actively hostile. Expect a Composer conflict wall: PHP version constraint, Symfony component version constraint, and an autoload map that registers a bundle class nothing will reference. Any adoption requires either forking into our VCS namespace or a replace/provide hack in composer.json — both of which are long-term ownership liabilities we would be taking on for zero capability gain.
Sequencing (if we are forced to touch it):
composer why theofidry/sfcontext-bundle to establish whether the dependency is direct or transitive; document the answer.app(), resolve(), Facade::getFacadeRoot(), or—preferably—constructor injection).conflict rule to prevent reintroduction.Maintenance — we would own it outright. An archived repository with no upstream means every future PHP bump, every Symfony component CVE in its transitive tree, and every behavioral bug becomes our ticket. There is no composer update path back to a maintainer.
Support — none. Four stars and zero dependents is a strong signal that no one has run this in production at scale. There is no community to escalate to, no Stack Overflow corpus, and no realistic path to a vendor SLA. Any incident is debugged from source.
Scaling — negligible runtime cost, meaningful architectural cost. The library itself is tiny and will not show up in a profile. The scaling risk is organizational: a static container accessor is a global mutable singleton by another name. It encourages service-locator sprawl, breaks the ability of static analysis (PHPStan/Psalm at high levels) to trace dependencies, and makes parallel test execution fragile because resolved instances leak across test cases (see Illuminate\Foundation\Testing\TestCase container refresh behavior).
Failure modes to expect:
register(), or a queue worker's early hook) resolves an unbound or partially bound container and returns null or throws.php artisan config:cache and route:cache bypass runtime container construction paths; code assuming a live static container can silently fall back to defaults.ClassNotFound/BindingResolutionException failures from boot time to request time.Ramp-up — negative. A Laravel-native engineer encountering SfContextBundle in a codebase loses time on three fronts: learning a Symfony bundle's semantics that do not apply, discovering the bundle never actually boots, and then being asked to perpetuate a pattern the framework explicitly moved away from. Onboarding cost is pure overhead.
Recommendation. Reject for adoption. Score (0.09) and signals (archived, 4 stars, 0 dependents, 2019 release) are consistent with a dead experiment, and the capability it offers is already native to Laravel. The only legitimate action item is a dependency-hygiene ticket: confirm this is not arriving transitively, and if it is, drive removal of the parent. Treat any proposal to add it as a signal that the author is porting Symfony habits rather than designing for Laravel, and address that at the design review level.
How can I help you explore Laravel packages today?