VersionCommand::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;
13
14
use Mage\Mage;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
use Mage\Command\AbstractCommand;
18
19
/**
20
 * Version Command, return the current version of Magallanes
21
 *
22
 * @author Andrés Montañez <[email protected]>
23
 */
24
class VersionCommand extends AbstractCommand
25
{
26
    /**
27
     * Configure the Command
28
     */
29 63
    protected function configure(): void
30
    {
31
        $this
32 63
            ->setName('version')
33 63
            ->setDescription('Get the version of Magallanes');
34
    }
35
36
    /**
37
     * Executes the Command
38
     */
39 1
    protected function execute(InputInterface $input, OutputInterface $output): int
40
    {
41 1
        $output->writeln(sprintf('Magallanes v%s [%s]', Mage::VERSION, Mage::CODENAME));
42
43 1
        return self::SUCCESS;
44
    }
45
}
46