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

Improve DX when missing filter class import #3307

Closed
wants to merge 1 commit into from

Conversation

norkunas
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no?
Deprecations? no
Tickets -
License MIT
Doc PR -

Improve DX to get more helpful message when missing import for filter class.

Currently we get:
The filter class "SearchFilter" does not implement "ApiPlatform\Core\Api\FilterInterface". Did you forget a use statement?

After this we'd get:

The filter class "SearchFilter" does not implement "ApiPlatform\Core\Api\FilterInterface" in "ApiPlatform\Core\Tests\Fixtures\DummyEntityInvalidFilter". Did you forget a use statement?

But this changes behavior a little bit, because now when constructing ApiFilter annotation with invalid class it won't throw directly.

@soyuka
Copy link
Member

soyuka commented Dec 17, 2019

I see, I agree that the message is clearer. I'd be 👍 to merge this as a new feature, may you check why the tests are failing though?

@norkunas norkunas closed this Jun 17, 2020
@norkunas norkunas deleted the filter-dx branch June 17, 2020 05:33
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.

2 participants