Completed
Pull Request — master (#299)
by
unknown
06: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
use Symfony\Component\DependencyInjection\Alias;
8
9
class OptionalValidatorPass implements CompilerPassInterface
10
{
11 5
    public function process(ContainerBuilder $container)
12
    {
13 5
        if (!$container->hasDefinition('validator')) {
14 1
            $container->removeDefinition('liip_functional_test.validator');
15 1
        }
16 5
    }
17
}
18