Completed
Push — master ( 4550b3...29065e )
by Daniel
12:09
created

LogDispatcherPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 10 1
1
<?php
2
3
4
namespace Cmobi\RabbitmqBundle\DependencyInjection\Compiler;
5
6
use Cmobi\RabbitmqBundle\Logger\LogDispatcher;
7
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Definition;
10
11
12
class LogDispatcherPass implements CompilerPassInterface
13
{
14
    private $path;
15
16
    public function __construct($path)
17
    {
18
        $this->path = $path;
19
    }
20
21
    public function process(ContainerBuilder $container)
22
    {
23
        $definition = new Definition(
24
            LogDispatcher::class,
25
            [
26
                'path' => $this->path
27
            ]
28
        );
29
        $container->setDefinition('cmobi_rabbitmq.logger', $definition);
30
    }
31
}