0 follower

Final Class Yiisoft\YiiDevTool\App\Command\Release\ReleaseNews

InheritanceYiisoft\YiiDevTool\App\Command\Release\ReleaseNews

Method Details

Hide inherited methods

getChanges() public method

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;
}