Completed
Pull Request — master (#299)
by
unknown
06:39
created

OptionalValidatorPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 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