Conditions | 2 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
1 | <?php |
||
22 | 1 | public function build(ContainerBuilder $container) |
|
23 | { |
||
24 | 1 | parent::build($container); |
|
25 | |||
26 | 1 | $container->addCompilerPass( |
|
27 | new class implements CompilerPassInterface |
||
28 | { |
||
29 | /** |
||
30 | * @inheritDoc |
||
31 | */ |
||
32 | public function process(ContainerBuilder $container) |
||
33 | { |
||
34 | $executorId = 'thruster_actions.executor'; |
||
35 | $executorDefinition = new Definition('Thruster\Component\Actions\Executor'); |
||
36 | |||
37 | $container->setDefinition($executorId, $executorDefinition); |
||
38 | |||
39 | foreach ($container->findTaggedServiceIds('thruster_action_executor') as $id => $tags) { |
||
40 | $definition = $container->getDefinition($id); |
||
41 | $name = call_user_func([$definition->getClass(), 'getSupportedAction']); |
||
42 | |||
43 | $executorDefinition->addMethodCall('addExecutor', [$name, new Reference($id)]); |
||
44 | } |
||
45 | } |
||
46 | } |
||
47 | ); |
||
48 | 1 | } |
|
49 | } |
||
50 |