CheckAssetsEnabledPass::process()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3.1406

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 3.1406
1
<?php
2
3
namespace Liip\MonitorBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Exception\LogicException;
8
9
class CheckAssetsEnabledPass implements CompilerPassInterface
10
{
11 1
    public function process(ContainerBuilder $container)
12
    {
13 1
        if ($container->has('liip_monitor.health_controller') && !$container->has('assets.packages')) {
14
            throw new LogicException('Controller support cannot be enabled unless the frameworkbundle "assets" support is also enabled.');
15
        }
16 1
    }
17
}
18