Move CenterResolverInterface auto-configuring to bundledefinition

It seems that the service encountered in bundle loaded before does not
works.
This commit is contained in:
Julien Fastré 2021-09-10 12:06:00 +02:00
parent addcf72ae6
commit f87f03b5c0
2 changed files with 3 additions and 6 deletions

View File

@ -3,6 +3,7 @@
namespace Chill\MainBundle; namespace Chill\MainBundle;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Resolver\CenterResolverInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Chill\MainBundle\DependencyInjection\CompilerPass\SearchableServicesCompilerPass; use Chill\MainBundle\DependencyInjection\CompilerPass\SearchableServicesCompilerPass;
@ -27,6 +28,8 @@ class ChillMainBundle extends Bundle
$container->registerForAutoconfiguration(LocalMenuBuilderInterface::class) $container->registerForAutoconfiguration(LocalMenuBuilderInterface::class)
->addTag('chill.menu_builder'); ->addTag('chill.menu_builder');
$container->registerForAutoconfiguration(CenterResolverInterface::class)
->addTag('chill_main.center_resolver');
$container->addCompilerPass(new SearchableServicesCompilerPass()); $container->addCompilerPass(new SearchableServicesCompilerPass());
$container->addCompilerPass(new ConfigConsistencyCompilerPass()); $container->addCompilerPass(new ConfigConsistencyCompilerPass());

View File

@ -8,12 +8,6 @@ services:
arguments: arguments:
- !tagged_iterator chill_main.center_resolver - !tagged_iterator chill_main.center_resolver
# do not autowire the directory Security/Resolver
_instanceof:
Chill\MainBundle\Security\Resolver\CenterResolverInterface:
tags:
- chill_main.center_resolver
# do not autowire the directory Security/Resolver # do not autowire the directory Security/Resolver
Chill\MainBundle\Security\Resolver\DefaultCenterResolver: Chill\MainBundle\Security\Resolver\DefaultCenterResolver:
autoconfigure: true autoconfigure: true