Completed
Push — master ( fb244a...6e9b12 )
by John
05:17
created

TestKernel   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBundles() 0 15 2
A getCacheDir() 0 4 1
A getLogDir() 0 4 1
A registerContainerConfiguration() 0 4 1
1
<?php declare(strict_types=1);
2
3
use Symfony\Component\Config\Loader\LoaderInterface;
4
use Symfony\Component\HttpKernel\Kernel;
5
6
//@codingStandardsIgnoreStart
7
class TestKernel extends Kernel
8
{
9
//@codingStandardsIgnoreEnd
10
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function registerBundles()
15
    {
16
        $bundles = [
17
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
18
            new \Symfony\Bundle\MonologBundle\MonologBundle(),
19
            new \KleijnWeb\SwaggerBundle\KleijnWebSwaggerBundle(),
20
            new \KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\PetStoreBundle(),
21
        ];
22
23
        if (0 === strpos($this->getEnvironment(), 'secure')) {
24
            $bundles[] = new \Symfony\Bundle\SecurityBundle\SecurityBundle();
25
        }
26
27
        return $bundles;
28
    }
29
30
    public function getCacheDir()
31
    {
32
        return __DIR__ . '/var/cache/' . $this->environment;
33
    }
34
35
    public function getLogDir()
36
    {
37
        return __DIR__ . '/var/logs/' . $this->environment;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function registerContainerConfiguration(LoaderInterface $loader)
44
    {
45
        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
46
    }
47
}
48