Completed
Push — master ( a83b14...54219d )
by Yaroslav
18:18
created

AppKernel   C

Complexity

Total Complexity 7

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 29

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 29
dl 0
loc 64
rs 5
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
B registerBundles() 0 41 3
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\SecurityBundle\SecurityBundle(),
13
            new Symfony\Bundle\TwigBundle\TwigBundle(),
14
            new Symfony\Bundle\MonologBundle\MonologBundle(),
15
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
17
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
18
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
19
            new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
20
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
21
            new WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle(),
22
            new Sonata\CoreBundle\SonataCoreBundle(),
23
            new Sonata\BlockBundle\SonataBlockBundle(),
24
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
25
            new Sonata\AdminBundle\SonataAdminBundle(),
26
            new Sonata\TranslationBundle\SonataTranslationBundle(),
27
            new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
28
            new Presta\SitemapBundle\PrestaSitemapBundle(),
29
            new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
30
            new Eko\FeedBundle\EkoFeedBundle(),
31
            new Liip\ImagineBundle\LiipImagineBundle(),
32
            new Hautelook\AliceBundle\HautelookAliceBundle(),
33
34
            new Harentius\BlogBundle\HarentiusBlogBundle(),
35
        ];
36
37
        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
38
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
39
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
40
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
41
42
            if ('dev' === $this->getEnvironment()) {
43
                $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
44
            }
45
        }
46
47
        return $bundles;
48
    }
49
50
    public function getRootDir()
51
    {
52
        return __DIR__;
53
    }
54
55
    public function getCacheDir()
56
    {
57
        return $this->getRootDir().'/var/cache/'.$this->getEnvironment();
58
    }
59
60
    public function getLogDir()
61
    {
62
        return $this->getRootDir().'/var/logs';
63
    }
64
65
    public function registerContainerConfiguration(LoaderInterface $loader)
66
    {
67
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
68
    }
69
}
70