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

Convert::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 2
b 0
f 0
nc 1
nop 2
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 1
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