Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz 12401b54e3 fix: use value equality for sortByField tie detection
ClosureExpressionVisitor::sortByField() decided ties with a strict
"===" identity check before falling through to the next sort field.
For object-typed fields (e.g. two DateTimeImmutable instances that
represent the same point in time but are not the same instance),
this check never passes, so secondary/tertiary Criteria::orderBy()
fields were silently ignored and the resulting comparator was not
antisymmetric (swapping the input order of two such elements changed
the sort result).

Replace the "===" tie check with the same "<=>" comparison already
used to determine ordering, so a tie is now detected whenever the
values are equal under that comparison, matching value semantics for
both scalars and comparable objects.

Fixes #437
2026-09-04 06:21:06 +02:00
upstream f0274aca89 Upstream doctrine/collections state of the touched files before 990f3f475a 2026-09-04 06:21:06 +02:00
dualfroz 2572a60593 fix: use value equality for sortByField tie detection
ClosureExpressionVisitor::sortByField() decided ties with a strict
"===" identity check before falling through to the next sort field.
For object-typed fields (e.g. two DateTimeImmutable instances that
represent the same point in time but are not the same instance),
this check never passes, so secondary/tertiary Criteria::orderBy()
fields were silently ignored and the resulting comparator was not
antisymmetric (swapping the input order of two such elements changed
the sort result).

Replace the "===" tie check with the same "<=>" comparison already
used to determine ordering, so a tie is now detected whenever the
values are equal under that comparison, matching value semantics for
both scalars and comparable objects.

Fixes #437
2026-09-06 02:39:00 +02:00
upstream dd6d913ae6 Upstream doctrine/collections state of the touched files before 5817703073 2026-09-04 06:21:06 +02:00