Skip to content

feat(doctrine): deprecate AbstractFilter base class#8330

Merged
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:feat/doctrine-deprecate-abstract-filter
Jun 17, 2026
Merged

feat(doctrine): deprecate AbstractFilter base class#8330
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:feat/doctrine-deprecate-abstract-filter

Conversation

@soyuka

@soyuka soyuka commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Mark the ORM and ODM Doctrine AbstractFilter base classes as @deprecated since API Platform 4.4.

How

Class-level PHPDoc @deprecated on both src/Doctrine/Orm/Filter/AbstractFilter.php and src/Doctrine/Odm/Filter/AbstractFilter.php:

@deprecated since API Platform 4.4, implement FilterInterface directly together with BackwardCompatibleFilterDescriptionTrait and the canonical QueryParameter-based filters (ExactFilter, PartialSearchFilter, EndSearchFilter, ComparisonFilter, OrFilter, …) instead; this class is removed in 6.0

Gives third parties extending AbstractFilter a migration window toward implementing ApiPlatform\Metadata\FilterInterface directly (the public BC path documented in #8326) + the canonical QueryParameter filters.

Why PHPDoc-only (no trigger_deprecation)

AbstractFilter is still extended by the first-party legacy filters (SearchFilter, BooleanFilter, NumericFilter, OrderFilter, DateFilter, RangeFilter, ExistsFilter, BackedEnumFilter). A runtime trigger in the base would self-fire on every internal instantiation and spam users. A PHPDoc tag gives static-analysis / IDE migration signalling without runtime noise. All subclasses keep extends AbstractFilter (no inheritance dropped).

BC

Zero BC break — annotation only. Removal target 6.0 (matches the repo's existing 4.4 @deprecated entries and TODO-filters 6.0 deliverables).

Part of the 4.4 filter refactor: ship replacement primaries, then deprecate legacy.

Mark the ORM and ODM Doctrine AbstractFilter base classes as @deprecated
since 4.4. Third parties extending AbstractFilter should implement
ApiPlatform\Metadata\FilterInterface directly together with
BackwardCompatibleFilterDescriptionTrait and the QueryParameter-based
filters (ExactFilter, PartialSearchFilter, EndSearchFilter,
ComparisonFilter, OrFilter, …). Removed in 6.0.

PHPDoc-only, no trigger_deprecation: the base ctor is still used by the
first-party legacy filters, so a runtime trigger would self-fire.
@soyuka soyuka merged commit c3fd6dd into api-platform:main Jun 17, 2026
9 of 94 checks passed
@soyuka soyuka deleted the feat/doctrine-deprecate-abstract-filter branch June 17, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant