Passed
Push — master ( f5d0a9...f61cc5 )
by Andreas
25:28
created

configPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 17
ccs 0
cts 7
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process() 0 5 1
1
<?php
2
namespace midcom\dependencyInjection;
3
4
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use midcom_config;
7
8
class configPass implements CompilerPassInterface
9
{
10
    /**
11
     * @var midcom_config
12
     */
13
    private $config;
14
15
    public function __construct(midcom_config $config)
16
    {
17
        $this->config = $config;
18
    }
19
20
    public function process(ContainerBuilder $container)
21
    {
22
        $container->set('config', $this->config);
23
        $logger = $container->getDefinition('logger.filehandler');
24
        $logger->addArgument($this->config->get('log_filename'));
0 ignored issues
show
Bug introduced by
The method get() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $logger->addArgument($this->config->/** @scrutinizer ignore-call */ get('log_filename'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
    }
26
}