Completed
Push — master ( 8e1573...db6321 )
by
unknown
16:08 queued 08:39
created

AppKernel   B

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 18

Importance

Changes 0
Metric Value
wmc 5
lcom 2
cbo 18
dl 0
loc 50
rs 7.3333
c 0
b 0
f 0
1
<?php
2
3
use Doctrine\Common\Annotations\AnnotationRegistry;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
use Symfony\Component\HttpKernel\Kernel;
6
7
$loader = require __DIR__.'/../../../vendor/autoload.php';
8
9
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
10
11
class AppKernel extends Kernel
12
{
13
    public function registerBundles()
14
    {
15
        $bundles = [
16
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
17
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
18
            new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(),
19
            new \Symfony\Bundle\SecurityBundle\SecurityBundle(),
20
            new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
21
            new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
22
            new \Oneup\FlysystemBundle\OneupFlysystemBundle(),
23
            new \Sonata\BlockBundle\SonataBlockBundle(),
24
            new \Sonata\CoreBundle\SonataCoreBundle(),
25
            new \Sonata\AdminBundle\SonataAdminBundle(),
26
            new \Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
27
            new \Knp\Bundle\MenuBundle\KnpMenuBundle(),
28
            new \MediaMonks\SonataMediaBundle\MediaMonksSonataMediaBundle(),
29
            new \AppBundle\AppBundle(),
30
        ];
31
32
        if (in_array($this->getEnvironment(), ['test'], true)) {
33
            $bundles[] = new Liip\FunctionalTestBundle\LiipFunctionalTestBundle();
34
            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
35
        }
36
37
        return $bundles;
38
    }
39
40
    public function registerContainerConfiguration(LoaderInterface $loader)
41
    {
42
        $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function getCacheDir()
49
    {
50
        return sprintf('%s/../var/cache/%s', $this->rootDir, $this->environment);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getLogDir()
57
    {
58
        return sprintf('%s/../var/logs', $this->rootDir);
59
    }
60
}