FlyingColoursTwilioTwoFactorExtension   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 12
c 1
b 0
f 1
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 26 4
1
<?php
2
3
namespace FlyingColours\TwilioTwoFactorBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
7
use Symfony\Component\Config\FileLocator;
8
use Symfony\Component\DependencyInjection\Loader;
9
10
class FlyingColoursTwilioTwoFactorExtension extends Extension
11
{
12 1
    public function load(array $configs, ContainerBuilder $container)
13
    {
14 1
        $config = $this->processConfiguration(new Configuration(), $configs);
15
16 1
        foreach($config as $l1 => $val1)
17
        {
18 1
            if(is_array($val1))
19
            {
20 1
                foreach ($val1 as $l2 => $val2)
21
                {
22 1
                    $container->setParameter(sprintf('flying_colours_twilio_two_factor.%s.%s', $l1, $l2), $val2);
23
                }
24
            }
25
            else
26
            {
27 1
                $container->setParameter(sprintf('flying_colours_twilio_two_factor.%s', $l1), $val1);
28
            }
29
30
        }
31
32 1
        $loader = new Loader\YamlFileLoader(
33 1
            $container,
34 1
            new FileLocator(__DIR__ . '/../Resources/config')
35
        );
36
37 1
        $loader->load('services.yml');
38
39
40 1
    }
41
}
42