Completed
Push — standalone ( d5557b...6e54cd )
by Philip
02:01
created

AppKernel   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 45
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\Tests\Functional\app;
4
5
use Symfony\Component\Config\Loader\LoaderInterface;
6
use Symfony\Component\HttpKernel\Kernel;
7
8
class AppKernel extends Kernel
9
{
10
    /**
11
     * @var array
12
     */
13
    private $bundleClasses;
14
15
    public function __construct($environment, $debug, $bundleClasses = [])
16
    {
17
        parent::__construct($environment, $debug);
18
        $this->bundleClasses = $bundleClasses;
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function registerBundles()
25
    {
26
        $bundlesFile = $this->getRootDir() . '/config/' . $this->getEnvironment() . '/bundles.php';
27
        if (!file_exists($bundlesFile)) {
28
            throw new \RuntimeException($bundlesFile . ' is missing');
29
        }
30
31
        return include $bundlesFile;
32
    }
33
34
    public function getCacheDir()
35
    {
36
        return sys_get_temp_dir() . '/ddrrestbundle/cache/';
37
    }
38
39
    public function getLogDir()
40
    {
41
        return sys_get_temp_dir() . '/ddrrestbundle/logs';
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function registerContainerConfiguration(LoaderInterface $loader)
48
    {
49
        $resource = $this->getRootDir() . '/config/' . $this->getEnvironment() . '/config.yml';
50
        $loader->load($resource);
51
    }
52
}
53