TestKernel   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCacheDir() 0 3 1
A getLogDir() 0 3 1
A setConfigurationFilename() 0 3 1
A registerContainerConfiguration() 0 3 1
A registerBundles() 0 6 1
1
<?php declare(strict_types=1);
2
3
namespace Karser\Recaptcha3Bundle\Tests;
4
5
use Symfony\Component\Config\Loader\LoaderInterface;
6
use Symfony\Component\HttpKernel\Kernel;
7
8
class TestKernel extends Kernel
9
{
10
    private $configurationFilename;
11
12
    /**
13
     * Defines the configuration filename.
14
     *
15
     * @param string $filename
16
     */
17
    public function setConfigurationFilename($filename)
18
    {
19
        $this->configurationFilename = $filename;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function registerBundles()
26
    {
27
        return [
28
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
29
            new \Symfony\Bundle\TwigBundle\TwigBundle(),
30
            new \Karser\Recaptcha3Bundle\KarserRecaptcha3Bundle(),
31
        ];
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function registerContainerConfiguration(LoaderInterface $loader)
38
    {
39
        $loader->load($this->configurationFilename);
40
    }
41
42
    public function getLogDir()
43
    {
44
        return sys_get_temp_dir().'/KarserRecaptcha3Bundle/log';
45
    }
46
47
    public function getCacheDir()
48
    {
49
        return sys_get_temp_dir().'/KarserRecaptcha3Bundle/cache/'.$this->environment;
50
    }
51
}
52