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

Deprecate not registering filters #6976

Merged

Conversation

franmomu
Copy link
Member

Subject

These changes force the user to register filters as services so in next major version a service locator could be used instead of the complete container.

I am targeting this branch, because these changes are BC.

Changelog

### Deprecated
- Deprecated not registering filters as a service.

@franmomu franmomu added the minor label Mar 28, 2021
@franmomu franmomu force-pushed the prepare_service_locator_filter branch 2 times, most recently from e05de1a to 0956cfd Compare March 28, 2021 14:35
phansys
phansys previously approved these changes Mar 28, 2021
UPGRADE-3.x.md Outdated Show resolved Hide resolved
@phansys phansys requested a review from a team March 28, 2021 16:40
@@ -13,9 +13,13 @@

namespace Sonata\AdminBundle\DependencyInjection\Compiler;

use Sonata\AdminBundle\Filter\FilterInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Copy link
Member

Choose a reason for hiding this comment

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

This blank line should be removed

Copy link
Member Author

@franmomu franmomu Mar 28, 2021

Choose a reason for hiding this comment

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

It is php-cs-fixer who adds that line.

use Sonata\AdminBundle\Filter\FilterFactoryInterface;
use Sonata\AdminBundle\Tests\Fixtures\Filter\BarFilter;
use Sonata\AdminBundle\Tests\Fixtures\Filter\FooFilter;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

Copy link
Member

Choose a reason for hiding this comment

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

Same

VincentLanglet
VincentLanglet previously approved these changes Mar 28, 2021
{
}

public function apply($query, $value): void
Copy link
Member

Choose a reason for hiding this comment

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

Next_major, add typehint ?

These changes force the user to register filters as services so in
next major version a service locator could be used instead of the
complete container.
@franmomu franmomu dismissed stale reviews from VincentLanglet and phansys via 7532bd0 March 28, 2021 19:43
@franmomu franmomu force-pushed the prepare_service_locator_filter branch from 0956cfd to 7532bd0 Compare March 28, 2021 19:43
@jordisala1991 jordisala1991 merged commit 4c5871f into sonata-project:3.x Mar 28, 2021
@jordisala1991
Copy link
Member

Thank you @franmomu

@franmomu franmomu deleted the prepare_service_locator_filter branch March 29, 2021 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants