Completed
Pull Request — 2.x (#556)
by Grégoire
03:14 queued 01:40
created

Kernel::getLogDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\Fixtures\App;
13
14
use ReflectionClass;
15
use Symfony\Cmf\Component\Testing\HttpKernel\TestKernel;
16
use Symfony\Component\Config\Loader\LoaderInterface;
17
18
class Kernel extends TestKernel
19
{
20
    public function configure()
21
    {
22
        $this->registerConfiguredBundles();
23
        $this->requireBundleSet('default');
24
        $this->requireBundleSets(['phpcr_odm']);
25
    }
26
27
    public function getKernelDir()
28
    {
29
        try {
30
            $refl = new ReflectionClass($this);
31
            $fname = $refl->getFileName();
32
            $kernelDir = dirname($fname);
33
34
            return $kernelDir;
35
        } catch (Execption $exception) {
0 ignored issues
show
Coding Style Comprehensibility introduced by Maximilian Berghoff
Consider adding a comment why this CATCH block is empty.
Loading history...
Bug introduced by Maximilian Berghoff
The class Sonata\DoctrinePHPCRAdmi...\Fixtures\App\Execption does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
36
37
        }
38
    }
39
40
    public function getCacheDir(): string
41
    {
42
        return sys_get_temp_dir().'/SonataDoctrinePhpcrAdminBundle/cache';
43
    }
44
45
    public function getLogDir(): string
46
    {
47
        return sys_get_temp_dir().'/SonataDoctrinePhpcrAdminBundle/logs';
48
    }
49
50
51
    public function registerContainerConfiguration(LoaderInterface $loader)
52
    {
53
        $loader->load(__DIR__ . '/config/config.php');
54
        $loader->load(__DIR__ . '/config/admin-test.xml');
55
    }
56
}
57