PHPackages                             vdhicts/keepachangelog-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. vdhicts/keepachangelog-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

vdhicts/keepachangelog-parser
=============================

Parser for the Keep A Changelog standard

v2.4.0(3mo ago)412.8k↑20%3MITPHPPHP &gt;=8.2CI failing

Since Feb 15Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vdhicts/keepachangelog-parser)[ Packagist](https://packagist.org/packages/vdhicts/keepachangelog-parser)[ Docs](https://github.com/vdhicts/keepachangelog-parser)[ RSS](/packages/vdhicts-keepachangelog-parser/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (14)Versions (10)Used By (0)

keepachangelog-parser
=====================

[](#keepachangelog-parser)

Parser for the Keep A Changelog standard.

Requirements
------------

[](#requirements)

This package requires at least PHP 8.2 or newer.

Installation
------------

[](#installation)

You can install the package via composer:

`composer require vdhicts/keepachangelog-parser`

Usage
-----

[](#usage)

This package is intended to be easy to use.

### Parsing the changelog

[](#parsing-the-changelog)

```
$content = file_get_contents('CHANGELOG.md');

$parser = new \Vdhicts\KeepAChangelog\Parser();
$changelog = $parser->parse($content);
```

### Using a different date format

[](#using-a-different-date-format)

The parser will parse the releases with the `Y-m-d` format by default. If you would like to use another format, you can just pass the format to the `setDateFormat` function.

```
$content = file_get_contents('CHANGELOG.md');

$parser = new \Vdhicts\KeepAChangelog\Parser();
$changelog = $parser
    ->setDateFormat('Y-m-d H:i:s')
    ->parse($content);
```

### Accessing the changelog

[](#accessing-the-changelog)

The parser will return a `Changelog` models, with contains a collection of `Release` models. The `Release` model contains a collection of `Section` models.

The changelog has several methods the retrieve information:

```
// Get the description of the changelog, which returns an array of lines
$descriptionHtml = implode('', $changelog->getDescription());

// Determine if the changelog has any releases
$changelog->hasReleases();

// Get the unreleased section
$unreleased = $changelog->getUnreleased();

// Get the latest release
$latestRelease = $changelog->getLatestRelease();
```

When all releases are retrieved, the newest will be the first and the unreleased will be the last one when present.

The release has several methods to get information about the release:

```
// Determine if the current one is the unreleased section
$isUnreleased = $release->isUnreleased();

// Get the version for the release
$version = $release->getVersion();

// Get the release date, will be null when not released or a date isn't provided
$data = $release->getReleasedAt();

// Get the tag reference, usually something like https://github.com/vdhicts/keepachangelog-parser/compare/v0.0.1...v1.0.0
$tagReference = $release->getTagReference();

// Get a specific section of the release
$added = $release->getSection(Section::ADDED);

// Get the collection of sections for the release
$sections = $release->getSections();
```

The section consists of a type (like Added, etc.) and an array of entries:

```
$type = $section->getType();
$entries = $section->getEntries();

$entriesHtml = implode('', $entries);
```

Tests
-----

[](#tests)

Unit tests are available in the `tests` folder. Run with:

`composer test`

When you want a code coverage report which will be generated in the `build/report` folder. Run with:

`composer test-coverage`

Contribution
------------

[](#contribution)

Any contribution is welcome, but it should meet the PSR-12 standard and please create one pull request per feature/bug. In exchange, you will be credited as contributor on this page.

Security
--------

[](#security)

If you discover any security related issues in this or other packages of Vdhicts, please email instead of using the issue tracker.

Support
-------

[](#support)

If you encounter a problem with this parser or has a question about it, feel free to open an issue on GitHub.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance80

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 82.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~213 days

Recently: every ~272 days

Total

8

Last Release

106d ago

Major Versions

v1.2.0 → v2.0.02023-03-23

PHP version history (3 changes)v1.0.0PHP ^8.0|^8.1

v2.0.0PHP &gt;=8.1

v2.3.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/88d23e7b707d1cfe0eea91c00590613f45e0c75cb0a3ce89354328332e5c0c02?d=identicon)[vdhicts](/maintainers/vdhicts)

---

Top Contributors

[![dvdheiden](https://avatars.githubusercontent.com/u/90568118?v=4)](https://github.com/dvdheiden "dvdheiden (32 commits)")[![julesjanssen](https://avatars.githubusercontent.com/u/492036?v=4)](https://github.com/julesjanssen "julesjanssen (4 commits)")[![fabianpnke](https://avatars.githubusercontent.com/u/36986615?v=4)](https://github.com/fabianpnke "fabianpnke (3 commits)")

---

Tags

keepachangelogphpparserchangelog

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vdhicts-keepachangelog-parser/health.svg)

```
[![Health](https://phpackages.com/badges/vdhicts-keepachangelog-parser/health.svg)](https://phpackages.com/packages/vdhicts-keepachangelog-parser)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[illuminate/mail

The Illuminate Mail package.

5910.6M497](/packages/illuminate-mail)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M341](/packages/drupal-core-dev)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
