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.
app() helper plus facade-style resolution; modern Symfony ships autowiring, ServiceSubscriberInterface, and #[AutowireLocator]. There is no gap left to purchase.Consider it only in this narrow set of conditions, all of which must hold:
composer.json.Look elsewhere — decisively — when:
app(), resolve(), or constructor injection. There is nothing to evaluate here.ServiceSubscriberInterface, and #[AutowireLocator] cover every legitimate use case with first-party support.Bottom line: do not adopt. This is a small, archived Symfony bundle that provides static access to Symfony's dependency injection container. It has not been updated since December 2019, has 4 GitHub stars and zero known dependents, and is explicitly archived by its author.
Why the answer is no, in three points:
What it costs us to skip: nothing. If a specific legacy script needs quick container access, an in-house helper is a few lines of code we own and can retire on our schedule.
What we should take from it: the pattern it enables — static service location — is one we should keep out of new code as a matter of architecture hygiene. Treat this evaluation as a documented "no" and move the effort to features that differentiate the product.
How can I help you explore Laravel packages today?