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

Convert   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 7
c 3
b 0
f 1
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 4 1
A execute() 0 8 1
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