Passed
Push — master ( 35eebd...7b8a1a )
by Roman
16:45
created

Kernel::configureRoutes()   B

Complexity

Conditions 7
Paths 64

Size

Total Lines 23
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 56

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 7
eloc 14
nc 64
nop 1
dl 0
loc 23
ccs 0
cts 15
cp 0
crap 56
rs 8.8333
c 2
b 0
f 0
1
<?php
2
3
namespace App;
4
5
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...
6
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...
7
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...
8
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...
9
10
use function dirname;
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__) . '/config/services.yaml')) {
22
            $container->import('../config/services.yaml');
23
            $container->import('../config/{services}_' . $this->environment . '.yaml');
24
        }
25
26
        if (is_file($path = dirname(__DIR__) . '/config/services.php')) {
27
            (require $path)($container->withPath($path), $this);
28
        }
29
    }
30
31
    protected function configureRoutes(RoutingConfigurator $routes): void
32
    {
33
        $routes->import('../config/{routes}/' . $this->environment . '/*.yaml');
34
        $routes->import('../config/{routes}/*.yaml');
35
36
        if (is_file(dirname(__DIR__) . '/config/routes.yaml')) {
37
            $routes->import('../config/routes.yaml');
38
        }
39
40
        $path = dirname(__DIR__) . '/src/Dictionary/config/routes.yaml';
41
        is_file($path) && $routes->import($path);
42
43
        $path = dirname(__DIR__) . '/src/Crossword/config/routes.yaml';
44
        is_file($path) && $routes->import($path);
45
46
        $path = dirname(__DIR__) . '/src/Game/config/routes.yaml';
47
        is_file($path) && $routes->import($path);
48
49
        $path = dirname(__DIR__) . '/src/Swagger/config/routes.yaml';
50
        is_file($path) && $routes->import($path);
51
52
        if (is_file($path = dirname(__DIR__) . '/config/routes.php')) {
53
            (require $path)($routes->withPath($path), $this);
54
        }
55
    }
56
}
57