Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** |
| 6 | * Fast Forward Development Tools for PHP projects. |
| 7 | * |
| 8 | * This file is part of fast-forward/dev-tools project. |
| 9 | * |
| 10 | * @author Felipe Sayão Lobato Abreu <github@mentordosnerds.com> |
| 11 | * @license https://opensource.org/licenses/MIT MIT License |
| 12 | * |
| 13 | * @see https://github.com/php-fast-forward/ |
| 14 | * @see https://github.com/php-fast-forward/dev-tools |
| 15 | * @see https://github.com/php-fast-forward/dev-tools/issues |
| 16 | * @see https://php-fast-forward.github.io/dev-tools/ |
| 17 | * @see https://datatracker.ietf.org/doc/html/rfc2119 |
| 18 | */ |
| 19 | |
| 20 | namespace FastForward\DevTools\Changelog\Manager; |
| 21 | |
| 22 | use FastForward\DevTools\Changelog\Document\ChangelogDocument; |
| 23 | use FastForward\DevTools\Changelog\Entry\ChangelogEntryType; |
| 24 | |
| 25 | /** |
| 26 | * Applies changelog mutations and derives release metadata. |
| 27 | */ |
| 28 | interface ChangelogManagerInterface |
| 29 | { |
| 30 | /** |
| 31 | * Adds a changelog entry to the selected release section. |
| 32 | * |
| 33 | * @param string $file |
| 34 | * @param ChangelogEntryType $type |
| 35 | * @param string $message |
| 36 | * @param string $version |
| 37 | * @param ?string $date |
| 38 | */ |
| 39 | public function addEntry( |
| 40 | string $file, |
| 41 | ChangelogEntryType $type, |
| 42 | string $message, |
| 43 | string $version = ChangelogDocument::UNRELEASED_VERSION, |
| 44 | ?string $date = null, |
| 45 | ): void; |
| 46 | |
| 47 | /** |
| 48 | * Promotes the Unreleased section into a published release. |
| 49 | * |
| 50 | * @param string $file |
| 51 | * @param string $version |
| 52 | * @param string $date |
| 53 | */ |
| 54 | public function promote(string $file, string $version, string $date): void; |
| 55 | |
| 56 | /** |
| 57 | * Returns the next semantic version inferred from unreleased entries. |
| 58 | * |
| 59 | * @param string $file |
| 60 | * @param ?string $currentVersion |
| 61 | */ |
| 62 | public function inferNextVersion(string $file, ?string $currentVersion = null): string; |
| 63 | |
| 64 | /** |
| 65 | * Returns the rendered notes body for a specific released version. |
| 66 | * |
| 67 | * @param string $file |
| 68 | * @param string $version |
| 69 | */ |
| 70 | public function renderReleaseNotes(string $file, string $version): string; |
| 71 | |
| 72 | /** |
| 73 | * Loads and parses the changelog file. |
| 74 | * |
| 75 | * @param string $file |
| 76 | */ |
| 77 | public function load(string $file): ChangelogDocument; |
| 78 | } |