Completed
Push — master ( ea4d71...e95b62 )
by David
9s
created

LoggerPass::process()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.0261

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 7
cp 0.8571
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 2
nop 1
crap 3.0261
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCacheBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
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 FOS\HttpCacheBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Announce the log listener to the symfony event system.
19
 */
20
class LoggerPass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function process(ContainerBuilder $container)
26
    {
27 1
        if (!$container->has('logger') || !$container->has('fos_http_cache.event_listener.log')) {
28
            return;
29
        }
30
31 1
        $container->getDefinition('fos_http_cache.event_listener.log')
32 1
            ->setAbstract(false)
33 1
            ->addTag('kernel.event_subscriber')
34
        ;
35 1
    }
36
}
37