Completed
Push — master ( 477f5d...23fcb0 )
by San
06:01
created

AppKernel   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 11

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 6
c 4
b 0
f 2
lcom 1
cbo 11
dl 0
loc 42
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBundles() 0 19 2
A getRootDir() 0 4 1
A getCacheDir() 0 4 1
A getLogDir() 0 4 1
A registerContainerConfiguration() 0 4 1
1
<?php
2
3
use \Symfony\Component\HttpKernel\Kernel;
4
use \Symfony\Component\Config\Loader\LoaderInterface;
5
6
class AppKernel extends Kernel
7
{
8
    public function registerBundles()
9
    {
10
        $bundles = [
11
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12
            new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
13
            new \Symfony\Bundle\MonologBundle\MonologBundle(),
14
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
15
            new \PommProject\PommBundle\PommBundle(),
16
            new \AppBundle\AppBundle(),
17
        ];
18
19
        if (in_array($this->getEnvironment(), ['dev', 'test'])) {
20
            $bundles[] = new \Symfony\Bundle\DebugBundle\DebugBundle();
21
            $bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
22
            $bundles[] = new \Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
23
        }
24
25
        return $bundles;
26
    }
27
28
    public function getRootDir()
29
    {
30
        return __DIR__;
31
    }
32
33
    public function getCacheDir()
34
    {
35
        return __DIR__ . '/../var/cache/' . $this->getEnvironment();
36
    }
37
38
    public function getLogDir()
39
    {
40
        return __DIR__ . '/../var/logs';
41
    }
42
43
    public function registerContainerConfiguration(LoaderInterface $loader)
44
    {
45
        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
46
    }
47
}
48