Completed
Push — develop ( a89061...54507c )
by Jaap
08:53
created

CilexCompatibilityLayerBundle::registerCommands()   B

Complexity

Conditions 3
Paths 3

Size

Total Lines 25
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 13
nc 3
nop 1
dl 0
loc 25
ccs 0
cts 20
cp 0
crap 12
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Application\CilexCompatibilityLayer;
6
7
use phpDocumentor\Application;
8
use phpDocumentor\Command\Helper\ConfigurationHelper;
9
use phpDocumentor\Command\Helper\LoggerHelper;
10
use Symfony\Component\Console\Input\InputOption;
11
use Symfony\Component\HttpKernel\Bundle\Bundle;
12
13
final class CilexCompatibilityLayerBundle extends Bundle
14
{
15
    public function boot()
16
    {
17
        parent::boot();
18
19
        if ($this->container->has(Application::class)) {
20
            $this->container->get(Application::class);
21
        }
22
    }
23
24
    public function registerCommands(\Symfony\Component\Console\Application $application)
25
    {
26
//        $application->getHelperSet()->set(new LoggerHelper());
0 ignored issues
show
Unused Code Comprehensibility introduced by
69% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
27
//        $application->getHelperSet()->set(new ConfigurationHelper($this->container->get('config')));
28
29
        $application->getDefinition()->addOption(
30
            new InputOption(
31
                'config',
32
                'c',
33
                InputOption::VALUE_OPTIONAL,
34
                'Location of a custom configuration file'
35
            )
36
        );
37
        $application->getDefinition()->addOption(
38
            new InputOption('log', null, InputOption::VALUE_OPTIONAL, 'Log file to write to')
39
        );
40
41
        if ($this->container->has('phpdocumentor.compatibility.extra_commands')) {
42
            $commands = $this->container->get('phpdocumentor.compatibility.extra_commands');
43
44
            foreach ($commands as $command) {
45
                $application->add($command);
46
            }
47
        }
48
    }
49
}
50