ObfuscatorCompilerPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace Rezzza\SecurityBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Reference;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
8
9
class ObfuscatorCompilerPass implements CompilerPassInterface
10
{
11
     /**
12
     * {@inheritdoc}
13
     */
14
    public function process(ContainerBuilder $container)
15
    {
16
        // request obfuscator is not enabled.
17
        if (!$container->getParameter('rezzza.security.request_obfuscator.enabled')) {
18
            return;
19
        }
20
21
        $container->setParameter('data_collector.request.class', 'Rezzza\SecurityBundle\DataCollector\RequestDataCollector');
22
23
        $container->getDefinition('data_collector.request')
24
            ->addArgument(new Reference('annotation_reader'))
25
            ->addArgument(new Reference('rezzza.security.request_obfuscator.obfuscator'));
26
    }
27
}
28