Passed
Pull Request — master (#15)
by Jeff
02:22
created

Kernel::getLogDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * This file is part of the mailserver-admin package.
6
 * (c) Jeffrey Boehm <https://github.com/jeboehm/mailserver-admin>
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace App;
12
13
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
14
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
15
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
16
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
17
18
class Kernel extends BaseKernel
19
{
20
    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 App\Kernel.
Loading history...
21
22
    protected function configureContainer(ContainerConfigurator $container): void
23
    {
24
        $container->import('../config/{packages}/*.yaml');
25
        $container->import('../config/{packages}/' . $this->environment . '/*.yaml');
26
27
        if (is_file(\dirname(__DIR__) . '/config/services.yaml')) {
28
            $container->import('../config/services.yaml');
29
            $container->import('../config/{services}_' . $this->environment . '.yaml');
30
        } elseif (is_file($path = \dirname(__DIR__) . '/config/services.php')) {
31
            (require $path)($container->withPath($path), $this);
32
        }
33
    }
34
35
    protected function configureRoutes(RoutingConfigurator $routes): void
36
    {
37
        $routes->import('../config/{routes}/' . $this->environment . '/*.yaml');
38
        $routes->import('../config/{routes}/*.yaml');
39
40
        if (is_file(\dirname(__DIR__) . '/config/routes.yaml')) {
41
            $routes->import('../config/routes.yaml');
42
        } elseif (is_file($path = \dirname(__DIR__) . '/config/routes.php')) {
43
            (require $path)($routes->withPath($path), $this);
44
        }
45
    }
46
}
47