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

Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/SignalSlotPass.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 LogicException;
12 use Symfony\Component\DependencyInjection\Reference;
13
17 class SignalSlotPass implements CompilerPassInterface
18 {
19 public function process(ContainerBuilder $container)
20 {
21 if (!$container->hasDefinition('ezpublish.signalslot.signal_dispatcher')) {
22 return;
23 }
24
25 $signalDispatcherDef = $container->getDefinition('ezpublish.signalslot.signal_dispatcher');
26 foreach ($container->findTaggedServiceIds('ezpublish.api.slot') as $id => $attributes) {
27 foreach ($attributes as $attribute) {
28 if (!isset($attribute['signal'])) {
29 throw new LogicException("Could not find 'signal' attribute on '$id' service, which is mandatory for services tagged as 'ezpublish.api.slot'");
30 }
31
32 $signalDispatcherDef->addMethodCall('attach', [$attribute['signal'], new Reference($id)]);
33 }
34 }
35 }
36 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\SignalSlotPass
This compiler pass will register slots in SignalDispatcher.
Definition: Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/SignalSlotPass.php:18
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\SignalSlotPass\process
process(ContainerBuilder $container)
Definition: Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/SignalSlotPass.php:19
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.