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