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 |
||
29 | 14 | public function __invoke(CommitCollection $commitCollection, string $version): string |
|
30 | { |
||
31 | 14 | $date = date('Y-m-d'); |
|
32 | 14 | $changelog = "# {$version} ({$date})\n\n"; |
|
33 | 14 | $sections = $commitCollection->getVisibleSections(); |
|
34 | 14 | foreach ($sections as $section) { |
|
35 | 14 | $changelog .= sprintf("### %s\n", $section->title); |
|
36 | 14 | foreach ($section->getCommits() as $commit) { |
|
37 | 14 | $changelog .= "- {$commit->comment}\n"; |
|
38 | } |
||
39 | 14 | $changelog .= "\n"; |
|
40 | } |
||
41 | |||
42 | 14 | return $changelog; |
|
43 | } |
||
45 |