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

MonologLoggerPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
rs 10

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
    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