Completed
Push — feature/try-update-symfony-32 ( c3055c...3b7d84 )
by Narcotic
09:37 queued 04:27
created

ReplaceTranslatorCompilerPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 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