Completed
Push — master ( 89edec...763b8f )
by Lukas Kahwe
13s
created

CheckAssetsEnabledPass::process()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 3
eloc 3
nc 2
nop 1
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
    /**
12
     * @param ContainerBuilder $container
13
     */
14
    public function process(ContainerBuilder $container)
15
    {
16
        if ($container->has('liip_monitor.health_controller') && !$container->has('assets.packages')) {
17
            throw new LogicException('Controller support cannot be enabled unless the frameworkbundle "assets" support is also enabled.');
18
        }
19
    }
20
}
21