Completed
Push — master ( 6421ea...db0bc7 )
by
unknown
10s
created

AppKernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 8

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 8
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBundles() 0 18 2
A registerContainerConfiguration() 0 9 2
1
<?php
2
3
namespace Smartbox\CoreBundle\Tests;
4
5
use Symfony\Component\HttpKernel\Kernel;
6
use Symfony\Component\Config\Loader\LoaderInterface;
7
use Smartbox\CoreBundle\DependencyInjection\CacheDriversCompilerPass;
8
9
class AppKernel extends Kernel
10
{
11
    public function registerBundles()
12
    {
13
        $bundles = [
14
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
15
            new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
16
            new \Symfony\Bundle\MonologBundle\MonologBundle(),
17
            new \JMS\SerializerBundle\JMSSerializerBundle(),
18
            new \Smartbox\CoreBundle\SmartboxCoreBundle(),
19
        ];
20
21
        switch ($this->getEnvironment()) {
22
            case CacheDriversCompilerPass::PREDEFINED_CACHE_DRIVER_PREDIS:
23
                $bundles[] = new \Snc\RedisBundle\SncRedisBundle();
24
                break;
25
        }
26
27
        return $bundles;
28
    }
29
30
    public function registerContainerConfiguration(LoaderInterface $loader)
31
    {
32
        $config = 'config';
33
        if ($this->getEnvironment() !== 'test') {
34
            $config = 'config_'.$this->getEnvironment();
35
        }
36
37
        $loader->load($this->getRootDir().'/config/'.$config.'.yml');
38
    }
39
}
40