RemoveExtensionsPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
c 0
b 0
f 0
nc 4
nop 1
dl 0
loc 8
rs 10
1
<?php
2
/**
3
 * @author Muhammed Akbulut <[email protected]>
4
 * @author Gerard van Helden <[email protected]>
5
 * @copyright Zicht Online <http://www.zicht.nl>
6
 */
7
8
namespace Zicht\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler;
9
10
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
13
/**
14
 * Class Pass
15
 *
16
 * @package Zicht\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler
17
 */
18
class RemoveExtensionsPass implements CompilerPassInterface
19
{
20
    /**
21
     * Adds extra configurations
22
     *
23
     * @param ContainerBuilder $container
24
     * @return null
25
     */
26
    public function process(ContainerBuilder $container)
27
    {
28
        if (!$container->hasExtension('doctrine')) {
29
            $container->removeDefinition('zicht_framework_extra.form.zicht_parent_choice_type');
30
        }
31
32
        if (!$container->hasExtension('liip_imagine')) {
33
            $container->removeDefinition('zicht_framework_extra.imagine.match_filter_loader');
34
        }
35
    }
36
}
37