Kernel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 0
cbo 4
dl 0
loc 58
ccs 15
cts 15
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A buildContainer() 0 7 1
A registerContainerConfiguration() 0 4 1
A registerBundles() 0 9 1
1
<?php
2
3
/**
4
 * This file is part of the CLIFramework package.
5
 *
6
 * (c) Arnaud VEBER <[email protected]>
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 CLIFramework;
13
14
use Symfony\Component\Config\Loader\LoaderInterface;
15
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
16
17
/**
18
 * Kernel.
19
 */
20
class Kernel extends BaseKernel
21
{
22
    /**
23
     * Construct the kernel.
24
     *
25
     * @param string $environment
26
     * @param boolean $debug
27
     */
28 11
    public function __construct($environment, $debug)
29
    {
30 11
        parent::__construct($environment, $debug);
31
32
        // boot kernel
33 11
        $this->boot();
34 11
    }
35
36
    /**
37
     * Register bundles.
38
     *
39
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use \Symfony\Bundle\MonologBundle\MonologBundle[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
40
     */
41 11
    public function registerBundles()
42
    {
43
        // register bundles for every environment
44
        $bundles = array(
45 11
            new \Symfony\Bundle\MonologBundle\MonologBundle(),
46 11
        );
47
48 11
        return $bundles;
49
    }
50
51
    /**
52
     * Builds the service container.
53
     *
54
     * @return \Symfony\Component\DependencyInjection\TaggedContainerInterface The compiled service container
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use \Symfony\Component\Depen...ection\ContainerBuilder.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
55
     *
56
     * @throws \RuntimeException
57
     */
58 6
    protected function buildContainer()
59
    {
60 6
        $container = parent::buildContainer();
61 6
        $container->setParameter('app.command.ids', array_keys($container->findTaggedServiceIds('app.command')));
62
63 6
        return $container;
64
    }
65
66
    /**
67
     * Register container configuration.
68
     *
69
     * @param \Symfony\Component\Config\Loader\LoaderInterface $loader
70
     *
71
     * @return void
72
     */
73 6
    public function registerContainerConfiguration(LoaderInterface $loader)
74
    {
75 6
        $loader->load(sprintf('%s/config/%s/config.yml', $this->getRootDir(), $this->getEnvironment()));
76 6
    }
77
}
78