Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
30 | 21 | public function __invoke(CommitCollection $commitCollection, string $version): string |
|
31 | { |
||
32 | 21 | $date = date('Y-m-d'); |
|
33 | 21 | $changelog = "# {$version} ({$date})\n\n"; |
|
34 | 21 | $sections = $commitCollection->getVisibleSections(); |
|
35 | 21 | foreach ($sections as $section) { |
|
36 | 21 | $changelog .= sprintf("### %s\n", $section->title); |
|
37 | 21 | foreach ($section->getCommits() as $commit) { |
|
38 | 21 | $changelog .= "- {$commit->comment}\n"; |
|
39 | } |
||
40 | 21 | $changelog .= "\n"; |
|
41 | } |
||
42 | |||
43 | 21 | return $changelog; |
|
44 | } |
||
51 |