MbarbeyU2fSecurityExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 16
ccs 10
cts 10
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 14 1
1
<?php
2
3
/*
4
 * This file is part of the U2F Security bundle.
5
 *
6
 * (c) Michael Barbey <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mbarbey\U2fSecurityBundle\DependencyInjection;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Extension\Extension;
16
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17
use Symfony\Component\Config\FileLocator;
18
19
class MbarbeyU2fSecurityExtension extends Extension
20
{
21 3
    public function load(array $configs, ContainerBuilder $container)
22
    {
23 3
        $loader = new XmlFileLoader(
24 3
            $container,
25 3
            new FileLocator(__DIR__.'/../Resources/config')
26
            );
27 3
        $loader->load('services.xml');
28
29 3
        $configuration = new Configuration();
30 3
        $config = $this->processConfiguration($configuration, $configs);
31
32 2
        $definition = $container->getDefinition('mbarbey_u2f_security.subscriber');
33 2
        $definition->replaceArgument(0, $config['authentication_route']);
34 2
        $definition->replaceArgument(1, $config['whitelist_routes']);
35 2
    }
36
}
37