TemplatingCompilerPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 4
nop 1
crap 3
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
 * @author GeLo <[email protected]>
19
 */
20
class TemplatingCompilerPass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 220
    public function process(ContainerBuilder $container)
26
    {
27 220
        if (!$container->hasDefinition('templating.engine.php')) {
28 210
            $container->removeDefinition('ivory_ck_editor.templating.helper');
29 168
        }
30
31 220
        if (!$container->hasDefinition('twig')) {
32 210
            $container->removeDefinition('ivory_ck_editor.twig_extension');
33 168
        }
34 220
    }
35
}
36