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

Sfcontext Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. What concrete problem is being solved — is there an inherited Symfony codebase or a shared internal library that already depends on this bundle?
  2. Is this arriving as a transitive dependency (e.g., pulled in by a legacy vendor package) rather than a deliberate choice? If so, the work item is removal, not adoption.
  3. Do we have any PHP 7.x / Symfony 3.4–4.x workloads still in the fleet that would even resolve the constraint set?
  4. Has anyone validated that app()/facades don't already cover the use case? Every static-container use case I can construct is covered.

Integration Approach

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

  1. Run composer why theofidry/sfcontext-bundle to establish whether the dependency is direct or transitive; document the answer.
  2. If transitive, identify the parent package and evaluate replacing that parent first — this is the highest-leverage step.
  3. Quarantine: if a fork is unavoidable for a short bridge period, vendor it under a team-owned namespace, pin the commit SHA, and add a deprecation ticket with an owner and date.
  4. Replace call sites with Laravel-native equivalents (app(), resolve(), Facade::getFacadeRoot(), or—preferably—constructor injection).
  5. Remove the dependency and add a Composer conflict rule to prevent reintroduction.

Operational Impact

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:

  • Bootstrap ordering — a static grab invoked before the Laravel application boots (e.g., in a Composer script, a package service provider's register(), or a queue worker's early hook) resolves an unbound or partially bound container and returns null or throws.
  • Octane state bleed — long-lived workers mean a container reference captured statically survives request boundaries and serves stale scoped instances, producing cross-request data leakage. This is the highest-severity failure mode.
  • Config caching — php artisan config:cache and route:cache bypass runtime container construction paths; code assuming a live static container can silently fall back to defaults.
  • Silent resolution — static accessors typically lack the type-safety of constructor injection, pushing ClassNotFound/BindingResolutionException failures from boot time to request time.
  • Test pollution — global state set in one test survives into the next unless explicitly reset, producing flaky suites that erode trust in CI.

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.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console