Skip to content

mjerwin/parseachangelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mjerwin/parseachangelog

Build Status HHVM Scrutinizer Packagist

A library for parsing change logs using the format defined by keepachangelog.com.

Installation

composer require mjerwin/parseachangelog

Basic Usage

Get changes by version

$changelog = new Reader('path_to_changelog.md');
$release = $changelog->getRelease('0.2.0');
print_r($release->getAdded());

Get all changes

$changelog = new Reader('path_to_changelog.md');
$releases = $changelog->getReleases();
foreach($releases as $release)
{
	echo $release->getVersion();
	foreach ($release->getChanged() as $change)
	{
		echo $change;
	}
}

Methods

getVersion()

Get the version number of the release e.g. 0.2.0

getDate()

Get the date of the release

getAdded()

Get an array of messages from the Added section

getChanged()

Get an array of messages from the Changed section

getDeprecated()

Get an array of messages from the Deprecated section

getRemoved()

Get an array of messages from the Removed section

getFixed()

Get an array of messages from the Fixed section

getSecurity()

Get an array of messages from the Security section

toArray()

Represents the release as an array

toJson()

Represents the release in JSON format

toXml()

Represents the release as XML

toHtml()

Represents thr release as HTML using erusev/parsedown