Test Failed
Branch master (c7fd68)
by Gaetano
06:34
created

Kernel::getProjectDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Db3v4l;
4
5
use Db3v4l\DependencyInjection\AddDBConsoleCommandPass;
6
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...
7
use Symfony\Component\Config\Loader\LoaderInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Config\Loader\LoaderInterface 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\Config\Resource\FileResource;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Config\Resource\FileResource 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\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...
10
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...
11
use Symfony\Component\Routing\RouteCollectionBuilder;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Routing\RouteCollectionBuilder 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
13
class Kernel extends BaseKernel
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Kernel
Loading history...
14
{
15
    use MicroKernelTrait;
16
17
    private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
18
19
    public function registerBundles(): iterable
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function registerBundles()
Loading history...
20
    {
21
        $contents = require $this->getProjectDir().'/config/bundles.php';
0 ignored issues
show
Coding Style introduced by
File is being conditionally included; use "include" instead
Loading history...
22
        foreach ($contents as $class => $envs) {
23
            if ($envs[$this->environment] ?? $envs['all'] ?? false) {
24
                yield new $class();
25
            }
26
        }
27
    }
28
29
    public function getProjectDir(): string
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getProjectDir()
Loading history...
30
    {
31
        return \dirname(__DIR__);
32
    }
33
34
    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function configureContainer()
Loading history...
35
    {
36
        $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
37
        $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || !ini_get('opcache.preload'));
38
        $container->setParameter('container.dumper.inline_factories', true);
39
        $confDir = $this->getProjectDir().'/config';
40
41
        $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
42
        $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');
43
        $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
44
        $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
45
    }
46
47
    protected function configureRoutes(RouteCollectionBuilder $routes): void
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function configureRoutes()
Loading history...
48
    {
49
        $confDir = $this->getProjectDir().'/config';
50
51
        $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');
52
        $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
53
        $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
54
    }
55
56
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
57
     * @param ContainerBuilder $container
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
58
     * Use this method to register compiler passes and manipulate the container during the building process.
59
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
60
    protected function build(ContainerBuilder $container)
61
    {
62
        $container->addCompilerPass(new AddDBConsoleCommandPass());
63
    }
64
}
65