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

LogDispatcherPass::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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
}