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

authPass::process()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 5
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 4
rs 10
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
}