Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
14 | public function process(ContainerBuilder $container) |
||
15 | { |
||
16 | if (!$container->hasDefinition('jdr.mailer.part_resolver_registry')) { |
||
17 | return; |
||
18 | } |
||
19 | |||
20 | $definition = $container->getDefinition( |
||
21 | 'jdr.mailer.part_resolver_registry' |
||
22 | ); |
||
23 | |||
24 | $taggedServices = $container->findTaggedServiceIds( |
||
25 | 'jdr.mailer.resolver' |
||
26 | ); |
||
27 | foreach ($taggedServices as $id => $tags) { |
||
28 | foreach ($tags as $attributes) { |
||
29 | $definition->addMethodCall( |
||
30 | 'addResolver', |
||
31 | array(new Reference($id), $attributes['part']) |
||
32 | ); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 |