Skip to content

[RFR] Improve autowiring #1152

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

Merged
merged 3 commits into from
Jun 1, 2017
Merged

[RFR] Improve autowiring #1152

merged 3 commits into from
Jun 1, 2017

Conversation

vincentchalamon
Copy link
Contributor

@vincentchalamon vincentchalamon commented Jun 1, 2017

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1151
License MIT
Doc PR api-platform/docs#214

@@ -13,6 +13,11 @@

namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection;

use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\FilterInterface;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ApiPlatform\Core\Api\FilterInterface.

@@ -13,14 +13,20 @@

namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\DependencyInjection;

use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\FilterInterface;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ApiPlatform\Core\Api\FilterInterface.

@vincentchalamon vincentchalamon changed the title [RFR] Improve autowiring [WIP] Improve autowiring Jun 1, 2017
@vincentchalamon
Copy link
Contributor Author

I'm just thinking about something: filters require id option on tag, but I though it would be removed. Is it too soon to auto-configure filters?

@dunglas
Copy link
Member

dunglas commented Jun 1, 2017

It's not required anymore because of #862.
However the name of the service must be defined explicitly, I'm not sure if it's compatible or not with the autoconfigure feature.

@vincentchalamon
Copy link
Contributor Author

Maybe autoconfigure is not the right way to declare filters. We should still declare them manually.

BTW @dunglas, #862 requires documentation to be updated.

@teohhanhui
Copy link
Contributor

Most of the filters you'd declare in your app are from API Platform anyway, so PSR-4 service discovery and autowiring (there's nothing to be wired up) doesn't really help.

@dunglas dunglas merged commit 5729058 into api-platform:master Jun 1, 2017
@dunglas
Copy link
Member

dunglas commented Jun 1, 2017

Thank you @vincentchalamon!

hoangnd25 pushed a commit to hoangnd25/core that referenced this pull request Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants