ChangelogRelease

Class
Final: Yes

Represents one Keep a Changelog release section.

Table of Contents

Properties

 : string|null
 : array<string, array<int, string>>
 : string

Methods

 : mixed
getDate()

Returns the release date when present.

 : string|null
getEntries()

Returns all entries keyed by changelog category.

 : array<string, array<int, string>>
getEntriesFor()

Returns the entries for a specific changelog category.

 : array<int, string>
getVersion()

Returns the section version label.

 : string
hasEntries()

Returns whether the section contains at least one meaningful entry.

 : bool
isUnreleased()

Returns whether this section is the active Unreleased section.

 : bool
withDate()

Returns a copy with the release date replaced.

 : self
withEntries()

Returns a copy with all entries replaced by the supplied map.

 : self
withEntry()

Returns a copy with an additional entry appended to the given category.

 : self
Properties

$entries

Private
private array<string, array<int, string>> $entries = []
Methods

__construct()

Public
public __construct( string  $version[, string|null  $date = null][, array<string, array<int, string>>  $entries = []]) : mixed
Parameters
$version : string
$date : string|null = null
$entries : array<string, array<int, string>> = []

getDate()

Public

Returns the release date when present.

public getDate() : string|null
Return values
string|null

getEntries()

Public

Returns all entries keyed by changelog category.

public getEntries() : array<string, array<int, string>>
Return values
array<string, array<int, string>>

getVersion()

Public

Returns the section version label.

public getVersion() : string
Return values
string

hasEntries()

Public

Returns whether the section contains at least one meaningful entry.

public hasEntries() : bool
Return values
bool

isUnreleased()

Public

Returns whether this section is the active Unreleased section.

public isUnreleased() : bool
Return values
bool

withDate()

Public

Returns a copy with the release date replaced.

public withDate( string|null  $date) : self
Parameters
$date : string|null
Return values
self

withEntries()

Public

Returns a copy with all entries replaced by the supplied map.

public withEntries( array<string, array<int, string>>  $entries) : self
Parameters
$entries : array<string, array<int, string>>
Return values
self