Test Failed
Pull Request — master (#39)
by Aleksandr
08:25
created

ConsumersListCompilerPass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 1
1
<?php
2
3
namespace OldSound\RabbitMqBundle\DependencyInjection\Compiler;
4
5
use OldSound\RabbitMqBundle\Logger\ExtraContextLogger;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Definition;
9
use Symfony\Component\DependencyInjection\Reference;
10
11
class ConsumersListCompilerPass implements CompilerPassInterface
12
{
13
    public function process(ContainerBuilder $container)
14
    {
15
        $taggedConsumers = $container->findTaggedServiceIds('old_sound_rabbit_mq.consumer');
16
        $consumerNames = array_map(fn ($tags) => $tags[0]['consumer'], $taggedConsumers);
17
        $container->setParameter('old_sound_rabbit_mq.allowed_consumer_names', $consumerNames);
18
    }
19
}