DumpCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 5 1
A execute() 0 13 1
1
<?php
2
3
/*
4
 * This file is part of the Magallanes package.
5
 *
6
 * (c) Andrés Montañez <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mage\Command\BuiltIn\Config;
13
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
use Mage\Command\AbstractCommand;
17
18
/**
19
 * Command for Dumping the Configuration
20
 *
21
 * @author Andrés Montañez <[email protected]>
22
 */
23
class DumpCommand extends AbstractCommand
24
{
25
    /**
26
     * Configure the Command
27
     */
28 63
    protected function configure(): void
29
    {
30
        $this
31 63
            ->setName('config:dump')
32 63
            ->setDescription('Dumps the Magallanes configuration');
33
    }
34
35
    /**
36
     * Execute the Command
37
     */
38 1
    protected function execute(InputInterface $input, OutputInterface $output): int
39
    {
40 1
        $this->requireConfig();
41
42 1
        $output->writeln('Starting <fg=blue>Magallanes</>');
43 1
        $output->writeln('');
44
45 1
        $output->writeln(sprintf('<comment>%s</comment>', var_export($this->runtime->getConfiguration(), true)));
46
47 1
        $output->writeln('');
48 1
        $output->writeln('Finished <fg=blue>Magallanes</>');
49
50 1
        return self::SUCCESS;
51
    }
52
}
53