Test Failed
Push — master ( 8e4267...dc8c67 )
by MusikAnimal
06:25
created

AppKernel::registerBundles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 24
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 18
nc 2
nop 0
dl 0
loc 24
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
use Symfony\Component\Config\Loader\LoaderInterface;
6
use Symfony\Component\HttpKernel\Kernel;
7
8
/**
9
 * Class AppKernel. Generated by Symfony.
10
 */
11
class AppKernel extends Kernel
12
{
13
    /**
14
     * AppKernel constructor.
15
     * @param string $environment
16
     * @param bool $debug
17
     */
18
    public function __construct(string $environment, bool $debug)
19
    {
20
        date_default_timezone_set('UTC');
21
        parent::__construct($environment, $debug);
22
    }
23
24
    /**
25
     * Registered bundles.
26
     * @return array|iterable|\Symfony\Component\HttpKernel\Bundle\BundleInterface[]
27
     */
28
    public function registerBundles()
29
    {
30
        $bundles = [
31
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
32
            new Symfony\Bundle\WebServerBundle\WebServerBundle(),
33
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
34
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
35
            new Symfony\Bundle\TwigBundle\TwigBundle(),
36
            new Symfony\Bundle\MonologBundle\MonologBundle(),
37
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
38
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
39
            new Snc\RedisBundle\SncRedisBundle(),
40
            new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle(),
41
            new JMS\SerializerBundle\JMSSerializerBundle(),
42
            new Nelmio\CorsBundle\NelmioCorsBundle(),
43
            new AppBundle\AppBundle(),
44
        ];
45
46
        if (in_array($this->getEnvironment(), [ 'dev', 'test' ], true)) {
47
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
48
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
49
        }
50
51
        return $bundles;
52
    }
53
54
    /**
55
     * Root directory of /app.
56
     * @return string
57
     */
58
    public function getRootDir(): string
59
    {
60
        return __DIR__;
61
    }
62
63
    /**
64
     * Cache directory.
65
     * @return string
66
     */
67
    public function getCacheDir(): string
68
    {
69
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment().'/';
70
    }
71
72
    /**
73
     * Log directory.
74
     * @return string
75
     */
76
    public function getLogDir(): string
77
    {
78
        return dirname(__DIR__).'/var/logs';
79
    }
80
81
    /**
82
     * Loads environmental configuration.
83
     * @param LoaderInterface $loader
84
     * @throws Exception
85
     */
86
    public function registerContainerConfiguration(LoaderInterface $loader): void
87
    {
88
        $loader->load($this->getProjectDir().'/config/config_'.$this->getEnvironment().'.yml');
89
    }
90
}
91