LamodaTacticianQueueExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 12
cts 12
cp 1
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\TacticianQueueBundle\DependencyInjection;
6
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Loader;
10
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
11
12
/**
13
 * This is the class that loads and manages your bundle configuration.
14
 *
15
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
16
 */
17
class LamodaTacticianQueueExtension extends Extension
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 1
    public function load(array $configs, ContainerBuilder $container)
23
    {
24 1
        $configuration = new Configuration();
25 1
        $config = $this->processConfiguration($configuration, $configs);
26
27 1
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
28 1
        $loader->load('services.yml');
29
30 1
        $container->setAlias(
31 1
            'lamoda_tactician_queue.command_bus',
32 1
            $config['tactician_id']
33
        );
34 1
        $container->setAlias(
35 1
            'lamoda_tactician_queue.command_serializer',
36 1
            $config['command_serializer_id']
37
        );
38 1
    }
39
}
40