Failed Conditions
Pull Request — 0.3 (#20)
by jean
06:00
created

ProcessNotifierCompilerPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Darkilliant\ProcessBundle\DependencyInjection\CompilerPass;
6
7
use Darkilliant\ProcessBundle\ProcessNotifier\ChainProcessNotifier;
8
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Reference;
11
12
class ProcessNotifierCompilerPass implements CompilerPassInterface
13
{
14
    public function process(ContainerBuilder $container)
15
    {
16
        $registryDefinition = $container->findDefinition(ChainProcessNotifier::class);
17
        $taggedServices = $container->findTaggedServiceIds('darkilliant_process_notifier');
18
19
        foreach ($taggedServices as $id => $tags) {
20
            $registryDefinition->addMethodCall('add', [
21
                new Reference($id),
22
            ]);
23
        }
24
    }
25
}
26