refactor(session): implement Contracts\Session\Session, decouple Store from Symfony (task 3.4) - #40
Open
agissept wants to merge 1 commit into
Conversation
…e from Symfony (task 3.4)
Bring Illuminate\Session\Store to the L13 shape: it now implements
Illuminate\Contracts\Session\Session (introduced in task 3.1) instead of the
Symfony-extending Illuminate\Session\SessionInterface. All Symfony HttpFoundation
coupling is removed from the store — the bag machinery ($bags/$metaBag/$bagData,
registerBag/getBag/getMetadataBag/getBagData, the loadSession/save bag loops,
clear()), the SessionBagInterface/MetadataBag/Request imports, and the
$lifetime params on invalidate()/migrate(). Adds the contract-required exists().
The Symfony bridge is the ported v13 SymfonySessionDecorator: Http\Request now
mirrors v13 (setLaravelSession/session()/getSession()/hasSession()) so the store
is wrapped in the decorator for Symfony-facing code while $request->session()
still returns the unwrapped Store. The two setSession callsites (Session\Middleware
and Application::prepareRequest) switch to setLaravelSession. The deleted
SessionInterface.php is dropped from the optimize compile list.
Deliberate fork-superset deviations (removed later, not needed to decouple Symfony):
- keep set()/replace()/remove()/getToken() — set()'s 7 app call sites migrate to
put() in a later B2 task; dropping now buys no decoupling.
- keep flash.{new,old} keys (not v13 _flash.*) — a live-session data-cutover
concern for the swap window, marked with a ponytail comment.
SCC-1 stays broken; ratchet unchanged (no new 4.2 patterns). Full suite green
(1641). Session suite green (23); 3 request/routing tests updated to the
setLaravelSession idiom.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agissept
force-pushed
the
migration/3.3b-collection-l13
branch
from
September 11, 2026 09:29
d2abb75 to
d35a07b
Compare
agissept
force-pushed
the
migration/3.4-session-symfony-decouple
branch
from
September 11, 2026 09:29
2b77722 to
6380c1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked di #38 (base
migration/3.3b-collection-l13) — retarget kemastersetelah #38 merge. Bagian dari chain #35→#36→#37→#38→ini.Apa
Task 3.4: bawa
Illuminate\Session\Storeke bentuk L13 — sekarangimplements Illuminate\Contracts\Session\Session(kontrak dari task 3.1), lepas dari SymfonySessionInterface. Ini melepas Session dari HttpFoundationSessionInterface/bag machinery (bagian SCC-1).Perubahan
Session\Store:implements Contracts\Session\Session; buang mesin bag Symfony ($bags/$metaBag/$bagData,registerBag/getBag/getMetadataBag/getBagData, loop bag diloadSession/save,clear()), import Symfony (SessionBagInterface/MetadataBag/Request), dan$lifetimediinvalidate()/migrate(). Tambahexists()(wajib kontrak).SymfonySessionDecorator(baru, verbatim v13): jembatan ke SymfonySessionInterface— bungkus Store,set()→put(),clear()→flush(), bag-method throwBadMethodCallException.Http\Request(mirror v13):setLaravelSession()bungkus Store di decorator;session()return Store un-wrapped; overridegetSession()/hasSession().$request->setSession($store)→setLaravelSession()(Session\Middleware,Application::prepareRequest).Session/SessionInterface.php+ entri compile-listoptimize; retarget type-hintMiddlewareke kontrak.Deviasi sengaja (fork-superset, dihapus nanti — bukan penghalang decouple)
set()/replace()/remove()/getToken()—set()dipakai 7 callsite app; migrasiset()→put()= task B2 terpisah. Keep = nol app-break sekarang.flash.{new,old}(bukan v13_flash.*) — data-cutover live-session di window swap; ditandaiponytail:comment.Verifikasi
driver()singleton = instance yg di-save Middleware),prepareRequesttak double-set, nol->getSession()->misuse di fork, appgetSession()cumagetId/get(ada di decorator → nilai identik), nol ref app ke interface yg dihapus, tak ada app class extends Store.setLaravelSession.🤖 Generated with Claude Code