MonologLoggerPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 2
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