Completed
Push — master ( 229988...6a739e )
by Adrien
02:23
created

OverrideServicesCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 3
1
<?php
2
3
namespace Neirda\Bundle\LiipThemeProvider\DependencyInjection\CompilerPass;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class OverrideServicesCompilerPass implements CompilerPassInterface
9
{
10
    /**
11
     * Override the default LiipThemeBundle services by the ones in this bundle
12
     *
13
     * {@inheritdoc}
14
     */
15
    public function process(ContainerBuilder $container)
16
    {
17
        if ($container->has('liip_theme.theme_controller')) {
18
            $container->setDefinition('liip_theme.theme_controller', $container->getDefinition('liip_theme_provider.theme_controller'));
19
        }
20
21
        if ($container->has('liip_theme.active_theme')) {
22
            $container->setDefinition('liip_theme.active_theme', $container->getDefinition('liip_theme_provider.active_theme'));
23
        }
24
    }
25
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
26