Completed
Pull Request — development (#795)
by Nick
04:52
created

Kernel::configureContainer()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Oc;
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
0 ignored issues
show
Bug introduced by
There is one abstract method registerBundles in this class; you could implement it, or declare this class as abstract.
Loading history...
11
{
12
    use MicroKernelTrait;
13
14 View Code Duplication
    protected function configureContainer(ContainerConfigurator $container): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        $container->import('../config/{packages}/*.php');
17
        $container->import('../config/{packages}/'.$this->environment.'/*.php');
18
19
        if (is_file($path = \dirname(__DIR__).'/config/services.php')) {
20
            (require $path)($container->withPath($path), $this);
21
        }
22
    }
23
24 View Code Duplication
    protected function configureRoutes(RoutingConfigurator $routes): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $routes->import('../config/{routes}/'.$this->environment.'/*.php');
27
        $routes->import('../config/{routes}/*.php');
28
29
        if (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
30
            (require $path)($routes->withPath($path), $this);
0 ignored issues
show
Bug introduced by
The method withPath() does not seem to exist on object<Symfony\Component...or\RoutingConfigurator>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
        }
32
    }
33
}
34