Completed
Push — master ( 839f22...1b3a7e )
by Pavel
04:14
created

CrudsTestKernel::buildContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
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\Config\Resource\FileResource;
10
use Symfony\Component\HttpKernel\Kernel;
11
12
abstract class CrudsTestKernel extends Kernel
13
{
14
    /** {@inheritdoc} */
15
    public function registerBundles()
16
    {
17
        return [
18
            new CrudsBundle(),
19
            new DoctrineBundle(),
20
            new MyBundle(),
21
            new FrameworkBundle(),
22
        ];
23
    }
24
25
    public function getCacheDir()
26
    {
27
        return __DIR__ . '/../../../build/' . $this->getClassName() . '/cache';
28
    }
29
30
    public function getLogDir()
31
    {
32
        return __DIR__ . '/../../../build/' . $this->getClassName() . '/logs';
33
    }
34
35
    /** {@inheritdoc} */
36
    public function registerContainerConfiguration(LoaderInterface $loader)
37
    {
38
        return $loader->load(__DIR__ . '/config.yml');
39
    }
40
41
    /** {@inheritdoc} */
42
    protected function buildContainer()
43
    {
44
        $container = parent::buildContainer();
45
        $container->addResource(new FileResource(__DIR__ . '/config.yml'));
46
        $container->addResource(new FileResource(__DIR__ . '/routing.yml'));
47
48
        return $container;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    private function getClassName()
55
    {
56
        $path = explode('\\', static::class);
57
58
        return array_pop($path);
59
    }
60
}
61