[14.x] Remove default order fallback for collection sorting#59989
Closed
jnoordsij wants to merge 2 commits into
Closed
[14.x] Remove default order fallback for collection sorting#59989jnoordsij wants to merge 2 commits into
jnoordsij wants to merge 2 commits into
Conversation
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
jnoordsij
force-pushed
the
remove-default-order-fallback
branch
from
June 4, 2026 15:16
6f74eb6 to
b4fa029
Compare
jnoordsij
marked this pull request as ready for review
June 4, 2026 15:17
Although previously functional, this was never documentend, and just introduced in laravel#59859 to verify consistent behavior
jnoordsij
force-pushed
the
remove-default-order-fallback
branch
from
June 4, 2026 15:27
b4fa029 to
325fad8
Compare
Member
|
Eh, I'm not sure it's worth the breaking change. |
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.
Working on #59859, I discovered a weird lax matching of sort directions in the (internal)
sortByManymethod on collections, that aims to results in ascending sort order whenever'asc'ortruewas passed, and descending order for any other value. Given that other values might not make sense (e.g. the['string', 'string']example refactored in #59988 seems weird?) or may even aim to achieve the opposite (e.g. one tries to pass['string', 'ASC']or['string', true]expecting the latter to meandescending: truelike in practically all other locations), I propose to remove this functionality entirely.The stricter docblocks introduced in #59988 should comply with the new allowed signatures, to allow people to spot this already when running static analysis on 13.x.
Note: this contains a cherry-pick from 13.x and is thus not ready for merge untilmasterreceives a downstream merge from13.xfirst.It also drops a test introduced in #59859 to test fallback logic, for this syntax that was never formally supported or documented.