Passed
Push — master ( 90d26e...0900bd )
by Andreas
18:22
created

authPass   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 4
1
<?php
2
namespace midcom\bundle\dependencyInjection;
3
4
use Symfony\Component\DependencyInjection\ContainerBuilder;
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
7
class authPass implements CompilerPassInterface
8
{
9 1
    public function process(ContainerBuilder $container)
10
    {
11 1
        foreach (['frontend' => 'form', 'backend' => 'simple'] as $name => $default) {
12 1
            $class = $container->getParameter('midcom.auth_' . $name);
13 1
            if ($class && $class !== $default) {
14 1
                $definition = $container->getDefinition('auth.' . $name);
15 1
                $definition->setClass($class);
16
            }
17
        }
18
    }
19
}