RenderSubscriberCompilerPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 3
eloc 4
nc 2
nop 1
crap 3
1
<?php
2
3
namespace Chris\Bundle\FrontRenderBundle\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class RenderSubscriberCompilerPass implements CompilerPassInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 1
    public function process(ContainerBuilder $container)
14
    {
15 1
        if (!in_array('twig', $container->getParameter('templating.engines')) &&
16 1
            $container->hasDefinition('front_render_bundle.render_subscriber')) {
17 1
            $container->removeDefinition('front_render_bundle.render_subscriber');
18 1
        }
19 1
    }
20
}
21