MonologLoggerPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the XiideaEasyAuditBundle package.
5
 *
6
 * (c) Xiidea <http://www.xiidea.net>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Xiidea\EasyAuditBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16
17
class MonologLoggerPass implements CompilerPassInterface
18
{
19
    #[\Override]
20
    public function process(ContainerBuilder $container): void
21
    {
22
        if (false === $container->hasAlias('logger')) {
23
            $container->removeDefinition('xiidea.easy_audit.mono_logger.service');
24
            return;
25
        }
26
27
        $definition = $container->getDefinition('xiidea.easy_audit.mono_logger.service');
28
29
        $definition->setPublic(true);
30
    }
31
}
32