Passed
Pull Request — develop (#130)
by Laurent
02:51 queued 01:23
created

Kernel::configureContainer()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 3
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Core\Infrastructure;
6
7
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
0 ignored issues
show
Bug introduced by
The type Symfony\Bundle\Framework...Kernel\MicroKernelTrait 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...
8
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Depend...r\ContainerConfigurator 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...
9
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpKernel\Kernel 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...
10
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Routin...tor\RoutingConfigurator 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...
11
12
class Kernel extends BaseKernel
13
{
14
    use MicroKernelTrait;
15
16
    protected function configureContainer(ContainerConfigurator $container): void
17
    {
18
        $container->import('../../../config/{packages}/*.yaml');
19
        $container->import('../../../config/{packages}/' . $this->environment . '/*.yaml');
20
21
        if (\is_file(\dirname(__DIR__, 3) . '/config/services.yaml')) {
22
            $container->import('../../../config/services.yaml');
23
            $container->import('../../../config/{services}_' . $this->environment . '.yaml');
24
        } elseif (\is_file($path = \dirname(__DIR__, 3) . '/config/services.php')) {
25
            (require $path)($container->withPath($path), $this);
26
        }
27
    }
28
29
    protected function configureRoutes(RoutingConfigurator $routes): void
30
    {
31
        $routes->import('../../../config/{routes}/' . $this->environment . '/*.yaml');
32
        $routes->import('../../../config/{routes}/*.yaml');
33
34
        if (\is_file(\dirname(__DIR__, 3) . '/config/routes.yaml')) {
35
            $routes->import('../../../config/routes.yaml');
36
        } elseif (\is_file($path = \dirname(__DIR__, 3) . '/config/routes.php')) {
37
            (require $path)($routes->withPath($path), $this);
38
        }
39
    }
40
}
41