DumpCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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