Completed
Push — master ( be0721...cced22 )
by Matthew
02:48
created

AppKernel   C

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 21

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 21
dl 0
loc 53
rs 6.1111
c 0
b 0
f 0
1
<?php
2
3
use Symfony\Component\HttpKernel\Kernel;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
6
class AppKernel extends Kernel
7
{
8
9
    public function registerBundles()
10
    {
11
        $bundles = [
12
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
13
            new Symfony\Bundle\WebServerBundle\WebServerBundle(),
14
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
15
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
16
            new Symfony\Bundle\TwigBundle\TwigBundle(),
17
            new Symfony\Bundle\MonologBundle\MonologBundle(),
18
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
19
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
20
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
21
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
22
            new Snc\RedisBundle\SncRedisBundle(),
23
            new FOS\RestBundle\FOSRestBundle(),
24
            new JMS\SerializerBundle\JMSSerializerBundle(),
25
            new Nelmio\CorsBundle\NelmioCorsBundle(),
26
            new AppBundle\AppBundle(),
27
        ];
28
29
        if (in_array($this->getEnvironment(), [ 'dev', 'test' ], true)) {
30
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
31
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
32
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
33
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
34
        }
35
36
        return $bundles;
37
    }
38
39
    public function getRootDir()
40
    {
41
        return __DIR__;
42
    }
43
44
    public function getCacheDir()
45
    {
46
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment().'/';
47
    }
48
49
    public function getLogDir()
50
    {
51
        return dirname(__DIR__).'/var/logs';
52
    }
53
54
    public function registerContainerConfiguration(LoaderInterface $loader)
55
    {
56
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
57
    }
58
}
59