FHCookieGuardExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
1
<?php
2
declare(strict_types=1);
3
4
namespace FH\Bundle\CookieGuardBundle\DependencyInjection;
5
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
10
11
/**
12
 * This is the class that loads and manages your bundle configuration.
13
 *
14
 * @link http://symfony.com/doc/current/cookbook/bundles/extension.html
15
 */
16
final class FHCookieGuardExtension extends Extension
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function load(array $configs, ContainerBuilder $container): void
22
    {
23
        $configuration = new Configuration();
24
        $config = $this->processConfiguration($configuration, $configs);
25
26
        $container->setParameter('fh_cookie_guard.cookie_name', $config['cookie_name']);
27
28
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
29
        $loader->load('twig.yml');
30
    }
31
}
32