Completed
Push — master ( 589f5d...2e0cd6 )
by Pavel
07:02
created

CrudsTestKernel::getCacheDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace ScayTrase\Api\Cruds\Tests\Fixtures\Common;
4
5
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
6
use ScayTrase\Api\Cruds\CrudsBundle;
7
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
8
use Symfony\Component\Config\Loader\LoaderInterface;
9
use Symfony\Component\HttpKernel\Kernel;
10
11
abstract class CrudsTestKernel extends Kernel
12
{
13
    /** {@inheritdoc} */
14
    public function registerBundles()
15
    {
16
        return [
17
            new CrudsBundle(),
18
            new DoctrineBundle(),
19
            new MyBundle(),
20
            new FrameworkBundle(),
21
        ];
22
    }
23
24
    public function getCacheDir()
25
    {
26
        return __DIR__ . '/../../../build/' . $this->getClassName() . '/cache';
27
    }
28
29
    public function getLogDir()
30
    {
31
        return __DIR__ . '/../../../build/' . $this->getClassName() . '/logs';
32
    }
33
34
    /** {@inheritdoc} */
35
    public function registerContainerConfiguration(LoaderInterface $loader)
36
    {
37
        return $loader->load(__DIR__ . '/config.yml');
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    private function getClassName()
44
    {
45
        $path = explode('\\', static::class);
46
47
        return array_pop($path);
48
    }
49
}
50