SymfonyProfilerPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 9 3
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\Bundle\DependencyInjection\CompilerPass;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Make sure we have all the dependencies for Symfony Profiler.
19
 *
20
 * @author Tobias Nyholm <[email protected]>
21
 */
22
class SymfonyProfilerPass implements CompilerPassInterface
23
{
24
    public function process(ContainerBuilder $container): void
25
    {
26
        if (!$container->hasDefinition('php_translation.data_collector')) {
27
            return;
28
        }
29
30
        if (!$container->hasDefinition('translator.data_collector')) {
31
            // No Symfony translation data collector was found. We cannot use our collection without it.
32
            $container->removeDefinition('php_translation.data_collector');
33
        }
34
    }
35
}
36