feat(doctrine): standalone Date/Exists filters, ComparisonFilter [between], deprecate RangeFilter#8351
Merged
Conversation
soyuka
force-pushed
the
filter-survivor-standalone
branch
from
June 29, 2026 09:00
e2abf4f to
d245ec2
Compare
Both ORM and ODM ExistsFilter stop extending the deprecated AbstractFilter (5.0 survivor rewrite). The change is structural: apply() still reads its value from $context['filters'] so the legacy declaration paths (Operation::$filters services, #[ApiFilter]) — which never produce a Parameter — keep working until 6.0. The concrete helpers previously inherited from AbstractFilter (ctor, properties accessors, isPropertyEnabled, name-converter handling, logger) are inlined; ManagerRegistryAwareInterface is kept for BC injection and the deprecated getDescription(). The ORM filter now reads class metadata from $queryBuilder->getEntityManager() instead of the injected ManagerRegistry, so the active filter path no longer depends on it; ODM keeps the registry since its aggregation Builder exposes no DocumentManager (consistent with the canonical ExactFilter).
ComparisonFilter now supports the full range syntax: alongside gt/gte/lt/lte/ne it parses [between]=X..Y, emitting a single BETWEEN clause on ORM (so the SQL optimizer treats it as a bounded range; X..X collapses to =) and the native gte/lte pair on ODM. ExactFilter gains the matching BETWEEN branch for the ORM path; the branch only fires for the 'between' operator, leaving normal usage untouched. This gives ComparisonFilter full parity with RangeFilter, whose operators are now a strict subset. RangeFilter is therefore redundant and reclassified from "5.0 overlay survivor" to doomed: deprecated now, removed in 6.0, codemod rewrites it to ComparisonFilter. The [between] URL syntax is preserved by ComparisonFilter, so there is no consumer-facing breaking change. The new-style FilteredRangeParameter fixtures (ORM + ODM) move to ComparisonFilter, which then serves as the functional spec for [between].
soyuka
force-pushed
the
filter-survivor-standalone
branch
3 times, most recently
from
June 29, 2026 13:54
c395c51 to
855bf91
Compare
DateFilter (ORM + ODM) stops extending the deprecated AbstractFilter, the last of the three 5.0 survivors (after ExistsFilter). It stays a genuine survivor rather than a ComparisonFilter overlay: its date semantics — isDateField, \DateTime/\DateTimeImmutable coercion by column immutability, typed setParameter, and the INCLUDE_NULL_* null-management — are not expressible through ComparisonFilter. The decouple is structural: the AbstractFilter::apply() loop is reintroduced as a local apply() (driving filterProperty over $context['filters'], the universal value source for both legacy and QueryParameter declarations), and the inherited helpers (ctor, properties accessors, isPropertyEnabled, name-converter handling, logger) are inlined. ManagerRegistryAwareInterface is kept for BC injection and the deprecated getDescription(); the ORM filter reads class metadata from $queryBuilder->getEntityManager() so the active path no longer depends on the registry, while ODM keeps it (its aggregation Builder exposes no DocumentManager).
soyuka
force-pushed
the
filter-survivor-standalone
branch
from
June 29, 2026 14:16
855bf91 to
aabd7e6
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.
Targets 5.0. Completes the standalone-filter work: the three filters that still extended the deprecated
AbstractFilterare decoupled from it, andRangeFilteris folded intoComparisonFilter.ExistsFilterstandalone (ORM + ODM)Both stop extending
AbstractFilter. The inherited helpers (constructor, property accessors,isPropertyEnabled, name-converter handling, logger) are inlined.apply()still reads its value from$context['filters'], so the legacy declaration paths (Operation::$filtersservices,#[ApiFilter]) — which never produce aParameter— keep working until 6.0. The ORM filter reads class metadata from$queryBuilder->getEntityManager()instead of the injectedManagerRegistry; ODM keeps the registry since its aggregationBuilderexposes noDocumentManager.ManagerRegistryAwareInterfaceis retained for BC injection and the deprecatedgetDescription().ComparisonFiltergains[between],RangeFilterdeprecatedComparisonFilternow parses[between]=X..Yalongsidegt/gte/lt/lte/ne, emitting a singleBETWEENclause on ORM (X..Xcollapses to=) and the nativegte/ltepair on ODM.ExactFiltergains the matchingBETWEENbranch on the ORM path; it only fires for thebetweenoperator, leaving normal usage untouched.This gives
ComparisonFilterfull parity withRangeFilter, whose operators are now a strict subset.RangeFilteris therefore deprecated (removed in 6.0; codemod rewrites it toComparisonFilter). The[between]URL syntax is preserved, so there is no consumer-facing breaking change to the query API.DateFilterstandalone (ORM + ODM)The last of the three survivors stops extending
AbstractFilter. It stays a genuine survivor rather than aComparisonFilteroverlay: its date semantics —isDateField,\DateTime/\DateTimeImmutablecoercion by column immutability, typedsetParameter, andINCLUDE_NULL_*null-management — are not expressible throughComparisonFilter. TheAbstractFilter::apply()loop is reintroduced locally (drivingfilterPropertyover$context['filters']), and the inherited helpers are inlined as above.Tests
ORM functional suites green locally (
ExistsFilterTest,DateFilterTest,ComparisonFilterTest,RangeFilterTest— 102 tests). ODM covered by CI.