Passed
Pull Request — master (#38)
by
unknown
10:47
created

AppKernel::getLogDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SymfonyBundles\RedisBundle\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(string $environment, bool $debug)
12
    {
13
        parent::__construct($environment, $debug);
14
15
        (new Filesystem())->remove($this->getCacheDir());
16
    }
17
18
    /**
19
     * registerBundles.
20
     *
21
     * @return object[]
22
     */
23
    public function registerBundles(): array
24
    {
25
        return [
26
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
27
            new \SymfonyBundles\RedisBundle\SymfonyBundlesRedisBundle(),
28
        ];
29
    }
30
31
    public function getRootDir(): string
32
    {
33
        return __DIR__;
34
    }
35
36
    public function getCacheDir(): string
37
    {
38
        return '/tmp/symfony-cache';
39
    }
40
41
    public function getLogDir(): string
42
    {
43
        return '/tmp/symfony-cache';
44
    }
45
46
    public function registerContainerConfiguration(LoaderInterface $loader): void
47
    {
48
        if (Kernel::VERSION_ID < 53000) {
49
            $loader->load($this->getRootDir() . '/config/config_test.yml');
50
51
            return;
52
        }
53
54
        $loader->load($this->getRootDir() . '/config/config_test_sf6.yml');
55
    }
56
}
57