Passed
Push — trunk ( aca09f...bd7f95 )
by Christian
14:04 queued 13s
created

Kernel   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A configureRoutes() 0 3 1
A registerBundles() 0 5 1
A getCacheDir() 0 3 1
A getLogDir() 0 3 1
A getProjectDir() 0 3 1
A configureContainer() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shopware\WebInstaller;
5
6
use Shopware\Core\Framework\Log\Package;
7
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
8
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
9
use Symfony\Bundle\TwigBundle\TwigBundle;
10
use Symfony\Component\Config\Loader\LoaderInterface;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
13
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
14
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
15
16
/**
17
 * @internal
18
 */
19
#[Package('core')]
20
class Kernel extends BaseKernel
21
{
22
    use MicroKernelTrait;
0 ignored issues
show
introduced by
The trait Symfony\Bundle\Framework...Kernel\MicroKernelTrait requires some properties which are not provided by Shopware\WebInstaller\Kernel: $instanceof, $name
Loading history...
23
24
    /**
25
     * @return BundleInterface[]
26
     */
27
    public function registerBundles(): array
28
    {
29
        return [
30
            new FrameworkBundle(),
31
            new TwigBundle(),
32
        ];
33
    }
34
35
    public function getProjectDir(): string
36
    {
37
        return __DIR__;
38
    }
39
40
    public function getLogDir(): string
41
    {
42
        return $this->getCacheDir();
43
    }
44
45
    public function getCacheDir(): string
46
    {
47
        return sys_get_temp_dir() . '/shopware-recovery@git_commit_short@' . md5(__DIR__) . '/';
48
    }
49
50
    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
51
    {
52
        $loader->load(__DIR__ . '/Resources/config/config.yml');
53
    }
54
55
    protected function configureRoutes(RoutingConfigurator $routes): void
56
    {
57
        $routes->import(__DIR__ . '/Controller');
58
    }
59
}
60