Final Class Yiisoft\YiiDevTool\App\Command\Release\ReleaseNews
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getChanges() | Yiisoft\ |
Method Details
| public string[] getChanges ( string[] $releaseNotes ) | ||
| $releaseNotes | string[] | |
public function getChanges(array $releaseNotes): array
{
$changes = [];
foreach ($releaseNotes as $note) {
$note = trim($note);
if ($note === '') {
continue;
}
$note = preg_replace('~\R\s*~' , ' ', $note);
$note = preg_replace(
'~^- (?:' . implode('|', Changelog::TYPES) . ')(?: #\d+(?:, #\d+)*)?:\s+~' ,
'',
$note,
);
$note = preg_replace('~^- \s*~' , '', $note);
$note = preg_replace('~\s+\(@[^)]*\)$~' , '', $note);
$changes[] = '- ' . $note;
}
return $changes;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.