private function formatEntry(string $entry, bool $withExtraLine = false) : string
    {
        $entry = sprintf('- %s', $entry);
        $entry = preg_replace("/\n(?!\s{2}|$)/s", "\n  ", $entry);
        if ("\n" !== $entry[-1]) {
            // All entries need to end with a new line.
            $entry .= "\n";
        }
        if ($withExtraLine) {
            // If an extra line is requested, append it
            $entry .= "\n";
        }
        return $entry;
    }
private function formatEntry(string $entry, bool $withExtraLine = false) : string
    {
        $entry = sprintf('- %s', $entry);
        $entry = preg_replace("/\n(?!\s{2}|$)/s", "\n  ", $entry);
        if ("\n" !== $entry[-1]) {
            // All entries need to end with a new line.
            $entry .= "\n";
        }
        if ($withExtraLine) {
            // If an extra line is requested, append it
            $entry .= "\n";
        }
        return $entry;
    }
private function formatEntry ( string $ entry , bool $ withExtraLine = false ) : string { $ entry = sprintf ( '- %s' , $ entry ) ; $ entry = preg_replace ( "/\n(?!\s{2}|$)/s" , "\n  " , $ entry ) ; if ( "\n" !== $ entry [ - 1 ] ) { // All entries need to end with a new line. $ entry .= "\n" ; } if ( $ withExtraLine ) { // If an extra line is requested, append it $ entry .= "\n" ; } return $ entry ; }
Formats the entry for use in the changelog.

Prepends the string '- ', and appends a newline if none is present.

If $withExtraLine is true, an extra newline is appended.

If the string spans multiple lines, it ensures all additional lines are
indented two characters.
Formats the entry for use in the changelog .