AppKernel   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A registerBundles() 0 5 1
A getRootDir() 0 3 1
A getLogDir() 0 3 1
A getCacheDir() 0 3 1
A registerContainerConfiguration() 0 3 1
1
<?php
2
3
namespace NW\JsonRequestBundle\Tests\Fixtures\app;
4
5
use Symfony\Component\HttpKernel\Kernel;
6
use Symfony\Component\Filesystem\Filesystem;
7
use Symfony\Component\Config\Loader\LoaderInterface;
8
9
class AppKernel extends Kernel
10
{
11
    public function __construct($environment, $debug)
12
    {
13
        parent::__construct($environment, $debug);
14
15
        (new Filesystem())->remove($this->getCacheDir());
16
    }
17
18
    public function registerBundles()
19
    {
20
        return [
21
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
22
            new \NW\JsonRequestBundle\NWJsonRequestBundle(),
23
        ];
24
    }
25
26
    public function getRootDir()
27
    {
28
        return __DIR__;
29
    }
30
31
    public function getCacheDir()
32
    {
33
        return '/tmp/symfony-cache';
34
    }
35
36
    public function getLogDir()
37
    {
38
        return '/tmp/symfony-cache';
39
    }
40
41
    public function registerContainerConfiguration(LoaderInterface $loader)
42
    {
43
        $loader->load($this->getRootDir() . '/config/config_test.yml');
44
    }
45
}
46