Passed
Push — main ( b13b1c...30676d )
by Emlyn
12:24
created

Convert::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 3
b 0
f 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
/**
3
 * @category Library
4
 * @license MIT http://opensource.org/licenses/MIT
5
 * @link https://github.com/emlynwest/changelog
6
 */
7
8
namespace ChangeLog\Console;
9
10
use Symfony\Component\Console\Command\Command;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
/**
15
 * Converts a release between formats.
16
 */
17
class Convert extends AbstractCommand
18
{
19
	/**
20
	 * @return string
21
	 * @codeCoverageIgnore
22
	 */
23
	public function getDescription(): string
24
	{
25
		return "Converts a release between formats.\n" .
26
			"Uses the global input, parser, renderer and output flags for processing.";
27
	}
28
29
	/**
30
	 * Reads and writes the log to covert the format.
31
	 *
32
	 * @param InputInterface  $input
33
	 * @param OutputInterface $output
34
	 */
35 1
	public function execute(InputInterface $input, OutputInterface $output): int
36
	{
37 1
		parent::execute($input, $output);
38
39 1
		$log = $this->changeLog->parse();
40 1
		$this->changeLog->write($log);
41
42 1
		return Command::SUCCESS;
43
	}
44
45
}
46