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

OverrideServicesCompilerPass::process()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 10
rs 9.4286
cc 3
eloc 5
nc 4
nop 1
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