Completed
Push — master ( 2ac5c9...413932 )
by Lukas Kahwe
03:39
created

OptionalValidatorPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Liip\FunctionalTestBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
8
class OptionalValidatorPass implements CompilerPassInterface
9
{
10 5
    public function process(ContainerBuilder $container)
11
    {
12 5
        if (!$container->hasDefinition('validator')) {
13 1
            $container->removeDefinition('liip_functional_test.validator');
14 1
        }
15 5
    }
16
}
17