CleanTemplatingPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 22
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 16 3
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map bundle package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMapBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class CleanTemplatingPass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 57
    public function process(ContainerBuilder $container)
26
    {
27 57
        if (!$container->hasDefinition('templating.engine.php')) {
28 56
            $container->removeDefinition('ivory.google_map.templating.api');
29 56
            $container->removeDefinition('ivory.google_map.templating.map');
30 56
            $container->removeDefinition('ivory.google_map.templating.map.static');
31 56
            $container->removeDefinition('ivory.google_map.templating.place_autocomplete');
32
        }
33
34 57
        if (!$container->hasDefinition('twig')) {
35 56
            $container->removeDefinition('ivory.google_map.twig.extension.api');
36 56
            $container->removeDefinition('ivory.google_map.twig.extension.map');
37 56
            $container->removeDefinition('ivory.google_map.twig.extension.map.static');
38 56
            $container->removeDefinition('ivory.google_map.twig.extension.place_autocomplete');
39
        }
40 57
    }
41
}
42