PopulateDebugCommandPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 13 2
1
<?php
2
3
namespace BornFree\TacticianDomainEventBundle\DependencyInjection\Compiler;
4
5
use BornFree\TacticianDomainEvent\EventDispatcher\EventSubscriberInterface;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
class PopulateDebugCommandPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        if (!$container->hasDefinition('tactician_domain_events.command.debug')) {
14
            return;
15
        }
16
17
        $command = $container->getDefinition('tactician_domain_events.command.debug');
18
        $subscribers = $container->findTaggedServiceIds('tactician.event_subscriber');
19
        $listeners = $container->findTaggedServiceIds('tactician.event_listener');
20
21
        $command->setArgument(1, $listeners);
22
        $command->setArgument(2, $subscribers);
23
    }
24
}
25