Completed
Push — master ( 3a24c5...edf7f7 )
by Tobias
45:53 queued 33:09
created

SymfonyProfilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 14
ccs 3
cts 6
cp 0.5
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 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
use Symfony\Component\DependencyInjection\Definition;
17
18
/**
19
 * Make sure we have all the dependencies for Symfony Profiler.
20
 *
21
 * @author Tobias Nyholm <[email protected]>
22
 */
23
class SymfonyProfilerPass implements CompilerPassInterface
24
{
25 1
    public function process(ContainerBuilder $container)
26
    {
27
        /* @var Definition $def */
28 1
        if (!$container->hasDefinition('php_translation.data_collector')) {
29 1
            return;
30
        }
31
32
        if (!$container->hasDefinition('translator.data_collector')) {
33
            throw new \LogicException('[PHP-Translation] To integrate with the Symfony profiler you first need to enable it. Please set framework.translator.enabled: true');
34
        }
35
    }
36
}
37