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

PlaceholderProviderPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
8
9 use LogicException;
10 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
11 use Symfony\Component\DependencyInjection\ContainerBuilder;
12 use Symfony\Component\DependencyInjection\Reference;
13
14 class PlaceholderProviderPass implements CompilerPassInterface
15 {
16 const TAG_NAME = 'ezpublish.placeholder_provider';
17 const REGISTRY_DEFINITION_ID = 'ezpublish.image_alias.imagine.placeholder_provider.registry';
18
19 public function process(ContainerBuilder $container)
20 {
21 if (!$container->hasDefinition(self::REGISTRY_DEFINITION_ID)) {
22 return;
23 }
24
25 $definition = $container->getDefinition(self::REGISTRY_DEFINITION_ID);
26 foreach ($container->findTaggedServiceIds(self::TAG_NAME) as $id => $attributes) {
27 foreach ($attributes as $attribute) {
28 if (!isset($attribute['type'])) {
29 throw new LogicException(self::TAG_NAME . ' service tag needs a "type" attribute to identify the placeholder provider type. None given.');
30 }
31
32 $definition->addMethodCall(
33 'addProvider',
34 [$attribute['type'], new Reference($id)]
35 );
36 }
37 }
38 }
39 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\PlaceholderProviderPass
Definition: PlaceholderProviderPass.php:15
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\PlaceholderProviderPass\REGISTRY_DEFINITION_ID
const REGISTRY_DEFINITION_ID
Definition: PlaceholderProviderPass.php:17
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\PlaceholderProviderPass\process
process(ContainerBuilder $container)
Definition: PlaceholderProviderPass.php:19
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\PlaceholderProviderPass\TAG_NAME
const TAG_NAME
Definition: PlaceholderProviderPass.php:16
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.