Passed
Push — master ( 03be53...8cd3b2 )
by BENOIT
02:26
created

Kernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureRoutes() 0 2 1
A configureContainer() 0 10 3
1
<?php
2
3
namespace BenTools\MercurePHP;
4
5
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
6
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
8
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
9
10
class Kernel extends BaseKernel
11
{
12
    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 BenTools\MercurePHP\Kernel.
Loading history...
13
14
    protected function configureContainer(ContainerConfigurator $container): void
15
    {
16
        $container->import('../config/{packages}/*.yaml');
17
        $container->import('../config/{packages}/' . $this->environment . '/*.yaml');
18
19
        if (is_file(\dirname(__DIR__) . '/config/services.yaml')) {
20
            $container->import('../config/{services}.yaml');
21
            $container->import('../config/{services}_' . $this->environment . '.yaml');
22
        } elseif (is_file($path = \dirname(__DIR__) . '/config/services.php')) {
23
            (require $path)($container->withPath($path), $this);
24
        }
25
    }
26
27
    protected function configureRoutes(RoutingConfigurator $routes): void
0 ignored issues
show
Unused Code introduced by
The parameter $routes 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

27
    protected function configureRoutes(/** @scrutinizer ignore-unused */ RoutingConfigurator $routes): 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...
28
    {
29
    }
30
}
31