Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | protected function execute(InputInterface $input, OutputInterface $output) |
||
34 | { |
||
35 | $root_path = \dirname(__DIR__) . '/../..'; |
||
36 | $raw_changelog = \file_get_contents($root_path . '/CHANGELOG.md'); |
||
37 | |||
38 | $app_version = $this->getApplication()->getVersion(); |
||
39 | |||
40 | // Reassign all unreleased changes to current unstable version. |
||
41 | if ( strpos($raw_changelog, $app_version) === false ) { |
||
42 | $raw_changelog = str_replace( |
||
43 | '[Unreleased]', |
||
44 | '[' . $app_version . ']', |
||
45 | $raw_changelog |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | $markdown_renderer = Renderer::createFromMarkdown($raw_changelog); |
||
50 | |||
51 | $this->io->writeln((string)$markdown_renderer); |
||
52 | } |
||
55 |