Kernel::build()   A
last analyzed

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AtlassianConnectBundle\Tests\Functional\App;
6
7
use AtlassianConnectBundle\AtlassianConnectBundle;
8
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
9
use Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle;
10
use Psr\Log\NullLogger;
11
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
12
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
13
use Symfony\Bundle\SecurityBundle\SecurityBundle;
14
use Symfony\Bundle\TwigBundle\TwigBundle;
15
use Symfony\Component\Config\Loader\LoaderInterface;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
18
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
19
20
final class Kernel extends BaseKernel
21
{
22
    use MicroKernelTrait;
0 ignored issues
show
Bug introduced by
The trait Symfony\Bundle\Framework...Kernel\MicroKernelTrait requires the property $instanceof which is not provided by AtlassianConnectBundle\Tests\Functional\App\Kernel.
Loading history...
23
24
    /**
25
     * @return array<BundleInterface>
26
     */
27
    public function registerBundles(): array
28
    {
29
        return [
30
            new FrameworkBundle(),
31
            new TwigBundle(),
32
            new SecurityBundle(),
33
            new DoctrineBundle(),
34
            new DoctrineFixturesBundle(),
35
            new AtlassianConnectBundle(),
36
        ];
37
    }
38
39
    public function getProjectDir(): string
40
    {
41
        return \dirname(__DIR__);
42
    }
43
44
    public function getCacheDir(): string
45
    {
46
        return sys_get_temp_dir().'/com.github.thecatontheflat.atlassian/tests/var/cache';
47
    }
48
49
    public function getLogDir(): string
50
    {
51
        return sys_get_temp_dir().'/com.github.thecatontheflat.atlassian/tests/var'.$this->environment.'/log';
52
    }
53
54
    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

54
    protected function configureContainer(/** @scrutinizer ignore-unused */ ContainerBuilder $container, LoaderInterface $loader): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        $configDir = $this->getProjectDir().'/config';
57
58
        $loader->load($configDir.'/{base}/*.yaml', 'glob');
59
60
        $loader->load($configDir.'/{packages}/*.yaml', 'glob');
61
        $loader->load($configDir.'/{services}.yaml', 'glob');
62
    }
63
64
    protected function build(ContainerBuilder $container): void
65
    {
66
        $container->register('logger', NullLogger::class);
67
    }
68
}
69