Skip to content

Commit 79252dc

Browse files
committed
feat(doctrine): deprecate the extends-AbstractFilter form of Date/Range/Exists filters
DateFilter, RangeFilter and ExistsFilter (ORM + ODM) still extend the AbstractFilter base deprecated in 4.4. Unlike the doomed legacy filters, these three survive: in 5.0 they are rewritten standalone (Date/Range as overlays over ComparisonFilter, Exists reading its value from the QueryParameter) — same class name, same URL syntax, drop-in. Add an @deprecated note on the legacy extends-AbstractFilter form so users migrate their declarations to QueryParameter ahead of the 5.0 rewrite. The classes themselves are not removed. PHPDoc-only, no runtime trigger.
1 parent 8f48b9d commit 79252dc

6 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/Doctrine/Odm/Filter/DateFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
* @author Kévin Dunglas <dunglas@gmail.com>
121121
* @author Théo FIDRY <theo.fidry@gmail.com>
122122
* @author Alan Poulain <contact@alanpoulain.eu>
123+
*
124+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone overlay over {@see ComparisonFilter} (translating the `[before]`/`[strictly_before]`/`[after]`/`[strictly_after]` syntax) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
123125
*/
124126
final class DateFilter extends AbstractFilter implements DateFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
125127
{

src/Doctrine/Odm/Filter/ExistsFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
*
111111
* @author Teoh Han Hui <teohhanhui@gmail.com>
112112
* @author Alan Poulain <contact@alanpoulain.eu>
113+
*
114+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone filter (reading its value from the QueryParameter instead of the legacy `context['filters']` lookup) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
113115
*/
114116
final class ExistsFilter extends AbstractFilter implements ExistsFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
115117
{

src/Doctrine/Odm/Filter/RangeFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
*
108108
* @author Lee Siong Chan <ahlee2326@me.com>
109109
* @author Alan Poulain <contact@alanpoulain.eu>
110+
*
111+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone overlay over {@see ComparisonFilter} (translating `[between]=X..Y` to `[gte]=X` + `[lte]=Y`, passing through `[gt]`/`[gte]`/`[lt]`/`[lte]`) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
110112
*/
111113
final class RangeFilter extends AbstractFilter implements RangeFilterInterface, OpenApiParameterFilterInterface
112114
{

src/Doctrine/Orm/Filter/DateFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@
124124
*
125125
* @author Kévin Dunglas <dunglas@gmail.com>
126126
* @author Théo FIDRY <theo.fidry@gmail.com>
127+
*
128+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone overlay over {@see ComparisonFilter} (translating the `[before]`/`[strictly_before]`/`[after]`/`[strictly_after]` syntax) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
127129
*/
128130
final class DateFilter extends AbstractFilter implements DateFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
129131
{

src/Doctrine/Orm/Filter/ExistsFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?exists[comment]=true`.
117117
*
118118
* @author Teoh Han Hui <teohhanhui@gmail.com>
119+
*
120+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone filter (reading its value from the QueryParameter instead of the legacy `context['filters']` lookup) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
119121
*/
120122
final class ExistsFilter extends AbstractFilter implements ExistsFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
121123
{

src/Doctrine/Orm/Filter/RangeFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price[between]=12.99..15.99`.
109109
*
110110
* @author Lee Siong Chan <ahlee2326@me.com>
111+
*
112+
* @deprecated since API Platform 4.4: extending {@see AbstractFilter} is deprecated. In 5.0 this filter is rewritten as a standalone overlay over {@see ComparisonFilter} (translating `[between]=X..Y` to `[gte]=X` + `[lte]=Y`, passing through `[gt]`/`[gte]`/`[lt]`/`[lte]`) — same class name, same URL syntax, drop-in. Declare it through a QueryParameter to migrate.
111113
*/
112114
final class RangeFilter extends AbstractFilter implements RangeFilterInterface, OpenApiParameterFilterInterface
113115
{

0 commit comments

Comments
 (0)