ChangelogDocument

Class
Read only: Yes Final: Yes

Represents the minimal Keep a Changelog document structure used by dev-tools.

Table of Contents

Constants

 = 'Unreleased'

Properties

 : array<string|int, mixed>

Methods

 : mixed
create()

Creates a new document with an empty Unreleased section.

 : self
getLatestPublishedRelease()

Returns the newest published release section when available.

 : ChangelogRelease|null
getRelease()

Returns the requested release section when present.

 : ChangelogRelease|null
getReleases()

Returns the release sections in document order.

 : array<int, ChangelogRelease>
getUnreleased()

Returns the Unreleased section, creating an empty one when needed.

 : ChangelogRelease
promoteUnreleased()

Returns a copy with the unreleased entries promoted into a published release.

 : self
withRelease()

Returns a copy with the provided release inserted or replaced.

 : self
normalizeUnreleasedPosition()

Ensures the Unreleased section stays first in the document.

 : array<int, ChangelogRelease>
Constants

Constants

UNRELEASED_VERSION

Public
public mixed UNRELEASED_VERSION = 'Unreleased'
Properties
Methods

create()

Public Static

Creates a new document with an empty Unreleased section.

public static create() : self
Return values
self

promoteUnreleased()

Public

Returns a copy with the unreleased entries promoted into a published release.

public promoteUnreleased( string  $version, string  $date) : self
Parameters
$version : string
$date : string
Return values
self