ProfilerCompilerPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 14 2
1
<?php
2
3
namespace Sitetheory\Bundle\ProfilerStorageBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class ProfilerCompilerPass implements CompilerPassInterface
9
{
10
    /**
11
     * You can modify the container here before it is dumped to PHP code.
12
     *
13
     * @param ContainerBuilder $container
14
     */
15
    public function process(ContainerBuilder $container)
16
    {
17
        $definition = $container->getDefinition('profiler');
18
        // Compatibility for Definitions from Symfony 2.7 to 3.3
19
        if (2 === count($definition->getArguments())) {
20
            $definition->addArgument(true);
21
        }
22
        $definition->addArgument('%sitetheory_profiler_storage.profiler.defaultStorage%');
23
        $definition->addArgument('%sitetheory_profiler_storage.profiler.class%');
24
        $definition->addArgument('%sitetheory_profiler_storage.profiler.dsn%');
25
        $definition->addArgument('%sitetheory_profiler_storage.profiler.username%');
26
        $definition->addArgument('%sitetheory_profiler_storage.profiler.password%');
27
        $definition->addArgument('%sitetheory_profiler_storage.profiler.ttl%');
28
        $definition->setClass('Sitetheory\Bundle\ProfilerStorageBundle\Profiler\Profiler');
29
    }
30
}
31