Completed
Push — master ( 618a28...d2b433 )
by Christophe
02:18
created

RenderSubscriberCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 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
    public function process(ContainerBuilder $container)
14
    {
15
        if (!in_array('twig', $container->getParameter('templating.engines')) &&
16
            $container->hasDefinition('front_render_bundle.render_subscriber')) {
17
            $container->removeDefinition('front_render_bundle.render_subscriber');
18
        }
19
    }
20
}
21