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

configPass::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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