Completed
Pull Request — master (#211)
by Eric
12:26 queued 04:51
created

TemplatingCompilerPass::process()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 3
eloc 5
nc 4
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory CKEditor 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\CKEditorBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Templating compiler pass.
19
 *
20
 * @author GeLo <[email protected]>
21
 */
22
class TemplatingCompilerPass implements CompilerPassInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function process(ContainerBuilder $container)
28
    {
29
        if (!$container->hasDefinition('templating.engine.php')) {
30
            $container->removeDefinition('ivory_ck_editor.templating.helper');
31
        }
32
33
        if (!$container->hasDefinition('twig')) {
34
            $container->removeDefinition('ivory_ck_editor.twig_extension');
35
        }
36
    }
37
}
38