Completed
Push — master ( be55b2...4e721e )
by Roni
01:29
created

MonologLoggerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 6
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
    public function process(ContainerBuilder $container)
20
    {
21
        if (false === $container->hasAlias('logger')) {
22
            $container->removeDefinition('xiidea.easy_audit.mono_logger.service');
23
            return;
24
        }
25
26
        $definition = $container->getDefinition('xiidea.easy_audit.mono_logger.service');
27
28
        $definition->setPublic(TRUE);
29
    }
30
}
31