EkinoNewRelicBundle   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 9
c 1
b 0
f 0
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A boot() 0 6 2
A shutdown() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Ekino New Relic bundle.
7
 *
8
 * (c) Ekino - Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\NewRelicBundle;
15
16
use Ekino\NewRelicBundle\DependencyInjection\Compiler\MonologHandlerPass;
17
use Ekino\NewRelicBundle\Listener\DeprecationListener;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\HttpKernel\Bundle\Bundle;
20
21
class EkinoNewRelicBundle extends Bundle
22
{
23
    public function build(ContainerBuilder $container)
24
    {
25
        parent::build($container);
26
27
        $container->addCompilerPass(new MonologHandlerPass());
28
    }
29
30
    public function boot()
31
    {
32
        parent::boot();
33
34
        if ($this->container->has(DeprecationListener::class)) {
35
            $this->container->get(DeprecationListener::class)->register();
36
        }
37
    }
38
39
    public function shutdown()
40
    {
41
        if ($this->container->has(DeprecationListener::class)) {
42
            $this->container->get(DeprecationListener::class)->unregister();
43
        }
44
45
        parent::shutdown();
46
    }
47
}
48