Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

ChainConfigResolverPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Reference;
12
16 class ChainConfigResolverPass implements CompilerPassInterface
17 {
21 public function process(ContainerBuilder $container)
22 {
23 if (!$container->hasDefinition('ezpublish.config.resolver.chain')) {
24 return;
25 }
26
27 $chainResolver = $container->getDefinition('ezpublish.config.resolver.chain');
28
29 foreach ($container->findTaggedServiceIds('ezpublish.config.resolver') as $id => $attributes) {
30 $priority = isset($attributes[0]['priority']) ? (int)$attributes[0]['priority'] : 0;
31 // Priority range is between -255 (the lowest) and 255 (the highest)
32 if ($priority > 255) {
33 $priority = 255;
34 }
35 if ($priority < -255) {
36 $priority = -255;
37 }
38
39 $chainResolver->addMethodCall(
40 'addResolver',
41 [
42 new Reference($id),
43 $priority,
44 ]
45 );
46 }
47 }
48 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\ChainConfigResolverPass
The ChainConfigResolverPass will register all services tagged as "ezpublish.config....
Definition: ChainConfigResolverPass.php:17
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\ChainConfigResolverPass\process
process(ContainerBuilder $container)
Definition: ChainConfigResolverPass.php:21
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.