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

ConsumersListCompilerPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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
}