Completed
Push — master ( 1c96c0...849954 )
by David
10s
created

FOSHttpCacheBundle::registerCommands()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
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;
13
14
use FOS\HttpCacheBundle\DependencyInjection\Compiler\HashGeneratorPass;
15
use FOS\HttpCacheBundle\DependencyInjection\Compiler\LoggerPass;
16
use FOS\HttpCacheBundle\DependencyInjection\Compiler\SessionListenerRemovePass;
17
use FOS\HttpCacheBundle\DependencyInjection\Compiler\TagListenerPass;
18
use Symfony\Component\Console\Application;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
use Symfony\Component\HttpKernel\Bundle\Bundle;
21
use Symfony\Component\HttpKernel\Kernel;
22
23
class FOSHttpCacheBundle extends Bundle
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 2
    public function build(ContainerBuilder $container)
29
    {
30 2
        $container->addCompilerPass(new LoggerPass());
31 2
        $container->addCompilerPass(new TagListenerPass());
32 2
        $container->addCompilerPass(new HashGeneratorPass());
33 2
        if (version_compare(Kernel::VERSION, '3.4', '>=')
34 2
            && version_compare(Kernel::VERSION, '4.1', '<')
35
        ) {
36
            $container->addCompilerPass(new SessionListenerRemovePass());
37
        }
38 2
    }
39
40 4
    public function registerCommands(Application $application)
41
    {
42
        // do nothing, commands are registered as services
43 4
    }
44
}
45