Skip to content

Commit 0f5d95c

Browse files
committed
feat(doctrine): deprecate the legacy SearchFilter/Boolean/Numeric/BackedEnum/OrderFilter
These multi-strategy and type-specific filters are superseded by the canonical QueryParameter-based set and are removed in 6.0: - SearchFilter -> ExactFilter / PartialSearchFilter / StartSearchFilter / EndSearchFilter (per strategy) - BooleanFilter -> ExactFilter + boolean nativeType - NumericFilter -> ExactFilter + numeric nativeType - BackedEnumFilter -> ExactFilter + backed-enum nativeType - OrderFilter -> SortFilter Add @deprecated notes (ORM + ODM; BackedEnumFilter is ORM-only) pointing at the replacement. PHPDoc-only, no runtime trigger - the wiring-level triggers (#[ApiFilter], Operation::$filters) land separately.
1 parent 8f48b9d commit 0f5d95c

9 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/Doctrine/Odm/Filter/BooleanFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
106106
* @author Teoh Han Hui <teohhanhui@gmail.com>
107107
* @author Alan Poulain <contact@alanpoulain.eu>
108+
*
109+
* @deprecated since API Platform 4.4: use {@see ExactFilter} declared with a boolean `nativeType` instead. Removed in 6.0.
108110
*/
109111
final class BooleanFilter extends AbstractFilter implements JsonSchemaFilterInterface
110112
{

src/Doctrine/Odm/Filter/NumericFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
106106
* @author Teoh Han Hui <teohhanhui@gmail.com>
107107
* @author Alan Poulain <contact@alanpoulain.eu>
108+
*
109+
* @deprecated since API Platform 4.4: use {@see ExactFilter} declared with a numeric `nativeType` (int/float) instead. Removed in 6.0.
108110
*/
109111
final class NumericFilter extends AbstractFilter implements JsonSchemaFilterInterface
110112
{

src/Doctrine/Odm/Filter/OrderFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@
199199
* @author Kévin Dunglas <dunglas@gmail.com>
200200
* @author Théo FIDRY <theo.fidry@gmail.com>
201201
* @author Alan Poulain <contact@alanpoulain.eu>
202+
*
203+
* @deprecated since API Platform 4.4: use {@see SortFilter} instead. Removed in 6.0.
202204
*/
203205
final class OrderFilter extends AbstractFilter implements OrderFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
204206
{

src/Doctrine/Odm/Filter/SearchFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
*
134134
* @author Kévin Dunglas <dunglas@gmail.com>
135135
* @author Alan Poulain <contact@alanpoulain.eu>
136+
*
137+
* @deprecated since API Platform 4.4: use the per-strategy QueryParameter-based filters instead — {@see ExactFilter} (`exact`), {@see PartialSearchFilter} (`partial`), {@see StartSearchFilter} (`start`), {@see EndSearchFilter} (`end`); for relation properties matched by IRI use {@see IriFilter}. Removed in 6.0.
136138
*/
137139
final class SearchFilter extends AbstractFilter implements SearchFilterInterface
138140
{

src/Doctrine/Orm/Filter/BackedEnumFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?status=published`.
108108
*
109109
* @author Rémi Marseille <marseille.remi@gmail.com>
110+
*
111+
* @deprecated since API Platform 4.4: use {@see ExactFilter} declared with a backed-enum `nativeType` instead. Removed in 6.0.
110112
*/
111113
final class BackedEnumFilter extends AbstractFilter
112114
{

src/Doctrine/Orm/Filter/BooleanFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
*
108108
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
109109
* @author Teoh Han Hui <teohhanhui@gmail.com>
110+
*
111+
* @deprecated since API Platform 4.4: use {@see ExactFilter} declared with a boolean `nativeType` instead. Removed in 6.0.
110112
*/
111113
final class BooleanFilter extends AbstractFilter implements JsonSchemaFilterInterface
112114
{

src/Doctrine/Orm/Filter/NumericFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
*
108108
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
109109
* @author Teoh Han Hui <teohhanhui@gmail.com>
110+
*
111+
* @deprecated since API Platform 4.4: use {@see ExactFilter} declared with a numeric `nativeType` (int/float) instead. Removed in 6.0.
110112
*/
111113
final class NumericFilter extends AbstractFilter implements JsonSchemaFilterInterface
112114
{

src/Doctrine/Orm/Filter/OrderFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@
198198
*
199199
* @author Kévin Dunglas <dunglas@gmail.com>
200200
* @author Théo FIDRY <theo.fidry@gmail.com>
201+
*
202+
* @deprecated since API Platform 4.4: use {@see SortFilter} instead. Removed in 6.0.
201203
*/
202204
final class OrderFilter extends AbstractFilter implements OrderFilterInterface, JsonSchemaFilterInterface, OpenApiParameterFilterInterface
203205
{

src/Doctrine/Orm/Filter/SearchFilter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
* </div>
133133
*
134134
* @author Kévin Dunglas <dunglas@gmail.com>
135+
*
136+
* @deprecated since API Platform 4.4: use the per-strategy QueryParameter-based filters instead — {@see ExactFilter} (`exact`), {@see PartialSearchFilter} (`partial`), {@see StartSearchFilter} (`start`), {@see EndSearchFilter} (`end`); for relation properties matched by IRI use {@see IriFilter}. Removed in 6.0.
135137
*/
136138
final class SearchFilter extends AbstractFilter implements SearchFilterInterface
137139
{

0 commit comments

Comments
 (0)