feat(support): bring Collection/Arr to L13 shape (task 3.3b) - #38
Open
agissept wants to merge 1 commit into
Open
feat(support): bring Collection/Arr to L13 shape (task 3.3b)#38agissept wants to merge 1 commit into
agissept wants to merge 1 commit into
Conversation
agissept
force-pushed
the
migration/3.3-support-collection-scc1
branch
from
September 11, 2026 08:46
36d9dd7 to
f017321
Compare
Copy the v13 collection-family into the fork's Support tree so the Collection surface matches Laravel 13, sourced verbatim from the clean v13.30.1 tag (git show) — NOT the local ../framework working tree, which sits on an inconsistent merge branch. New files: Enumerable, Traits/EnumeratesValues, LazyCollection, HigherOrderCollectionProxy, Item/MultipleItemsFoundException, functions.php (enum_value), Contracts/Support/CanBeEscapedWhenCastToString, and a minimal SortDirection enum reconstructed because v13 references it from Collection::sort*() but ships no defining file. Two deliberate deviations from verbatim copy: - strip `TransformsToResourceCollection` from Collection — it pulls in Http\Resources and would undo the SCC-1 decoupling from task 3.3a. - keep the 4.2 holdovers the fork's Database layer still calls (Collection::lists()/fetch(), Arr::build()/fetch()); removed in task 2.5. Arr: keep the fork class (first/last already v13 value-first), add from/mapWithKeys/partition/select, and flip Arr::where to v13 value-first semantics (fix its whereNotNull + UrlGenerator callers). Eloquent\Collection (only Collection subclass): widen contains()/unique() and delegate the v13 args to parent; drop the now-redundant max()/min() overrides (base v13 handles model collections via data_get). Update SupportCollectionTest/SupportArrTest assertions to v13 semantics (immutable sort, key-preserving chunk/takeLast, keys()->Collection, random-on-empty throws, toJson via jsonSerialize, offsetExists via isset) and MorphTo::gatherKeysByType (->values()) for v13 map key-preservation. Full suite green (1641); SCC-1 stays broken; ratchet baseline tightened (macroable_trait 14->12, legacy_contracts 50->37). 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
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 on #37 (task 3.3a). Completes Wave 1 — the fork's
Collectionsurface now matches Laravel 13, so the app can start exercising L13 Collection idioms.What
Copy the v13 collection-family into the fork's
Supporttree, sourced verbatim from the cleanv13.30.1tag (git show) — not the local../frameworkworking tree (it sits on an inconsistent merge branch).New:
Enumerable,Traits/EnumeratesValues,LazyCollection,HigherOrderCollectionProxy,Item/MultipleItemsFoundException,functions.php(enum_value),Contracts/Support/CanBeEscapedWhenCastToString, and a minimalSortDirectionenum (v13 references it fromCollection::sort*()but ships no defining file — dangling even upstream; only::Ascending/::Descendingare ever used).Deliberate deviations from verbatim copy
TransformsToResourceCollection— it pulls inHttp\Resourcesand would undo the SCC-1 decoupling from refactor(support): break SCC-1 — decouple Support from Http & Container (task 3.3a) #37.Collection::lists()/fetch(),Arr::build()/fetch()); removed later in task 2.5.Reconciliation
first/lastalready v13 value-first): addfrom/mapWithKeys/partition/select; flipArr::whereto v13 value-first (ARRAY_FILTER_USE_BOTH) and fix itswhereNotNull+UrlGeneratorcallers.Eloquent\Collection(only subclass): widencontains()/unique()and delegate the v13 args toparent::; drop the redundantmax()/min()overrides (base v13 handles model collections viadata_get).keys()→Collection, random-on-empty throws,toJsonviajsonSerialize,offsetExistsviaisset).MorphTo::gatherKeysByTypegets->values()for v13mapkey-preservation.v13
Collection::mappreserves keys where 4.2 reindexed. Only one fork site surfaced (MorphTo, fixed). App code that assumesmap()reindexes may silently produce keyed arrays — worth watching when you wire this fork into the app. Broader app sweep is a separate deferred task.Verification
grepSupport→Http/Container concrete = 0).macroable_trait14→12,legacy_contracts50→37.🤖 Generated with Claude Code