ChangelogDocument
Represents the minimal Keep a Changelog document structure used by dev-tools.
Constants
Properties
Methods
Creates a new document with an empty Unreleased section.
Returns the newest published release section when available.
Returns the requested release section when present.
Returns the release sections in document order.
Returns the Unreleased section, creating an empty one when needed.
Returns a copy with the unreleased entries promoted into a published release.
Returns a copy with the provided release inserted or replaced.
Ensures the Unreleased section stays first in the document.
public
__construct(
array<int, ChangelogRelease>
$releases) : mixed
Parameters
Creates a new document with an empty Unreleased section.
public
static
create() : self
Return values
Returns the newest published release section when available.
public
getLatestPublishedRelease() : ChangelogRelease|null
Return values
Returns the requested release section when present.
public
getRelease(
string
$version) : ChangelogRelease|null
Parameters
$version
:
string
Return values
Returns the release sections in document order.
public
getReleases() : array<int, ChangelogRelease>
Return values
Returns the Unreleased section, creating an empty one when needed.
public
getUnreleased() : ChangelogRelease
Return values
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
Returns a copy with the provided release inserted or replaced.
public
withRelease(ChangelogRelease
$target) : self
Parameters
Return values
Ensures the Unreleased section stays first in the document.
private
normalizeUnreleasedPosition(
array<int, ChangelogRelease>
$releases) : array<int, ChangelogRelease>