Completed
Push — master ( 8413a9...d75c00 )
by Narcotic
10:07
created

ReplaceTranslatorCompilerPass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 1
1
<?php
2
/**
3
 * overrides the default translator with ours..
4
 */
5
6
namespace Graviton\I18nBundle\DependencyInjection\Compiler;
7
8
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
/**
12
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
13
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
14
 * @link     http://swisscom.ch
15
 */
16
class ReplaceTranslatorCompilerPass implements CompilerPassInterface
17
{
18
19
    /**
20
     * create mapping from services
21
     *
22
     * @param ContainerBuilder $container container builder
23
     * @return void
24
     */
25 2
    public function process(ContainerBuilder $container)
26
    {
27 2
        $def = $container->findDefinition('translator.default');
28 2
        $def->setClass('Graviton\I18nBundle\Translator\Translator');
29 2
        $container->setDefinition('translator.default', $def);
30 2
    }
31
}
32