AppKernel   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
c 0
b 0
f 0
dl 0
loc 50
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getLogDir() 0 3 1
A getProjectDir() 0 3 1
A unserialize() 0 3 1
A registerBundles() 0 7 1
A getRootDir() 0 3 1
A getCacheDir() 0 3 1
A registerContainerConfiguration() 0 3 1
A serialize() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Sil\RouteSecurityBundle\Tests\Fixtures;
5
6
use Symfony\Component\Config\Loader\LoaderInterface;
7
use Symfony\Component\HttpKernel\Kernel;
8
9
/**
10
 * App Test Kernel for functional tests.
11
 */
12
class AppKernel extends Kernel
13
{
14
    public function __construct($environment, $debug)
15
    {
16
        parent::__construct($environment, $debug);
17
    }
18
19
    public function registerBundles()
20
    {
21
        return array(
22
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
23
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
24
            new \Sil\RouteSecurityBundle\SilRouteSecurityBundle(),
25
            new \Symfony\Bundle\SecurityBundle\SecurityBundle()
26
        );
27
    }
28
29
    public function getRootDir()
30
    {
31
        return __DIR__;
32
    }
33
34
    public function getProjectDir()
35
    {
36
        return __DIR__.'/../';
37
    }
38
39
    public function getCacheDir()
40
    {
41
        return sys_get_temp_dir().'/'.Kernel::VERSION.'/sil-route-security/cache/'.$this->environment;
42
    }
43
44
    public function getLogDir()
45
    {
46
        return sys_get_temp_dir().'/'.Kernel::VERSION.'/sil-route-security/logs';
47
    }
48
49
    public function registerContainerConfiguration(LoaderInterface $loader)
50
    {
51
        $loader->load(__DIR__.'/config/base_config.yaml');
52
    }
53
54
    public function serialize()
55
    {
56
        return serialize(array($this->getEnvironment(), $this->isDebug()));
57
    }
58
59
    public function unserialize($str)
60
    {
61
        call_user_func_array(array($this, '__construct'), unserialize($str));
62
    }
63
}
64