Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(doctrine-filters): reference date filters constants from parent interface #2057

Open
wants to merge 1 commit into
base: 4.0
Choose a base branch
from

Conversation

vinceAmstoutz
Copy link
Contributor

This PR refactors references to constants by switching from child to parent class references.

When child classes use constants defined in the base class (\ApiPlatform\Doctrine\Common\Filter\DateFilterInterface), they inherit these constants directly from the parent. This approach enhances reusability and maintainability, ensuring that standardized values like INCLUDE_NULL_BEFORE_AND_AFTER and other date-filtering constants are accessed directly from the source.

This simplifies future modifications to constants and reduces the risk of inconsistencies across classes implementing or extending date-filtering behavior.

Phpstorm also warns it:

Constant from base class '\ApiPlatform\Doctrine\Common\Filter\DateFilterInterface' referenced via child class

…ent interface

Switched to using parent class constants directly in child classes for date-filtering strategies. Enhances code maintainability and consistency by centralizing constant values in the base interface (`DateFilterInterface`).
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