MarkdownRenderer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 19
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderNote() 0 15 4
1
<?php
2
/**
3
 * Changelog keeper
4
 *
5
 * @link      https://github.com/hiqdev/chkipper
6
 * @package   chkipper
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\chkipper\lib\changelog;
12
13
use hiqdev\chkipper\lib\Note;
14
15
/**
16
 * Markdown changelog renderer.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class MarkdownRenderer extends \hiqdev\chkipper\lib\renderers\MarkdownRenderer
21
{
22
    protected $normalization = Normalization::class;
23
24
    public function renderNote(Note $note)
25
    {
26
        $str = $this->renderNoteHead($note);
27
        if (!$str) {
28
            return;
29
        }
30
        $authors = [];
31
        foreach ($note->getCommits() as $commit) {
32
            $authors[$commit->getAuthor()] = '[' . $commit->getAuthor() . ']';
33
        }
34
        if ($authors) {
35
            $str .= ' (' . implode(', ', $authors) . ')';
36
        }
37
38
        return $str;
39
    }
40
}
41