Completed
Push — wip-subtree ( 04b705...405079 )
by
unknown
12:15
created

PatcherListCommand::execute()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 3
eloc 15
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of the Blast Project package.
5
 *
6
 * Copyright (C) 2015-2017 Libre Informatique
7
 *
8
 * This file is licenced under the GNU LGPL v3.
9
 * For the full copyright and license information, please view the LICENSE.md
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Blast\Bundle\CoreBundle\Command;
14
15
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
16
use Symfony\Component\Console\Input\InputInterface;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
class PatcherListCommand extends ContainerAwareCommand
20
{
21
    use PatcherConfig,
22
        PatcherLogger;
23
24
    protected function configure()
25
    {
26
        $this
27
            ->setName('blast:patchs:list')
28
            ->setDescription('List Patches from Librinfo on misc vendors');
29
    }
30
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        $this->loadConfig();
34
35
        $this->info("\nListing available patches:\n\n");
36
        $this->info('  - - - -  ');
37
        foreach ($this->config['patches'] as $patch) {
38
            $this->info('id: ', false);
39
            $this->comment($patch['id']);
40
            $this->info('enabled: ', false);
41
            $this->comment($patch['enabled'] ? 'true' : 'false');
42
            // $this->info('patched: ', false);
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% 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...
43
            // $this->comment($patch['patched'] ? 'true' : 'false');
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...
44
            $this->info('targetFile: ', false);
45
            $this->comment($patch['targetFile']);
46
            $this->info('patchFile: ', false);
47
            $this->comment($patch['patchFile']);
48
            $this->info('  - - - -  ');
49
        }
50
51
        $this->displayMessages($output);
52
    }
53
}
54