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

CilexCompatibilityLayerBundle   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
B registerCommands() 0 25 3
A boot() 0 8 2
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