Refactor our environment handler to decorate the original one
This commit is contained in:
@@ -88,7 +88,6 @@ final class SymfonyExtension implements Extension
|
||||
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$this->processEnvironmentHandler($container);
|
||||
}
|
||||
|
||||
private function registerMinkDriver(ExtensionManager $extensionManager): void
|
||||
@@ -137,8 +136,7 @@ final class SymfonyExtension implements Extension
|
||||
{
|
||||
$definition = new Definition(ContextServiceEnvironmentHandler::class, [
|
||||
new Reference(self::KERNEL_ID),
|
||||
new Reference(ContextExtension::FACTORY_ID),
|
||||
new Reference(ContextExtension::AGGREGATE_RESOLVER_FACTORY_ID)
|
||||
new Reference('environment.handler.context'),
|
||||
]);
|
||||
$definition->addTag(EnvironmentExtension::HANDLER_TAG, ['priority' => 128]);
|
||||
|
||||
@@ -247,13 +245,4 @@ final class SymfonyExtension implements Extension
|
||||
|
||||
return is_string($bootstrap) ? $bootstrap : null;
|
||||
}
|
||||
|
||||
private function processEnvironmentHandler(ContainerBuilder $container): void
|
||||
{
|
||||
$definition = $container->findDefinition('fob_symfony.environment_handler.context_service');
|
||||
|
||||
foreach ($container->findTaggedServiceIds(ContextExtension::CLASS_RESOLVER_TAG) as $serviceId => $tags) {
|
||||
$definition->addMethodCall('registerClassResolver', [$container->getDefinition($serviceId)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user