CorrelationIdExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Phauthentic\CorrelationIdBundle\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
 * @see http://symfony.com/doc/current/cookbook/bundles/extension.html
16
 */
17
class CorrelationIdExtension extends Extension
18
{
19
    public function load(array $configs, ContainerBuilder $container): void
20
    {
21
        $configuration = new Configuration();
22
        $config = $this->processConfiguration($configuration, $configs);
23
24
        $container->setParameter('correlation_id.request_header_name', $config['response_header_name']);
25
        $container->setParameter('correlation_id.response_header_name', $config['response_header_name']);
26
        $container->setParameter('correlation_id.pass_through', $config['pass_through']);
27
28
        $yamlLoader = new Loader\YamlFileLoader(
29
            $container,
30
            new FileLocator(__DIR__ . '/../../config')
31
        );
32
33
        $yamlLoader->load('services.yaml');
34
    }
35
}
36