PHPackages                             xavierleune/php-changelog-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xavierleune/php-changelog-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xavierleune/php-changelog-generator
===================================

PHP tool to detect API changes and generate changelog with SemVer compliance

v0.8.0(3mo ago)05MITPHPPHP ^8.3CI passing

Since Jun 21Pushed 3mo agoCompare

[ Source](https://github.com/xavierleune/php-changelog-generator)[ Packagist](https://packagist.org/packages/xavierleune/php-changelog-generator)[ RSS](/packages/xavierleune-php-changelog-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (9)Used By (0)

PHP Changelog Generator
=======================

[](#php-changelog-generator)

A PHP tool to automatically detect API changes between two versions of a PHP project and generate a changelog following SemVer principles.

Features
--------

[](#features)

- ✅ Analysis of public elements only (classes, interfaces, methods, functions, constants)
- ✅ Support for native PHP signatures and PHPDoc
- ✅ Detection of compatible/incompatible changes
- ✅ Automatic SemVer recommendations (major/minor/patch)
- ✅ Markdown changelog generation
- ✅ Support for exclusion patterns
- ✅ Compatible with PHP 7.4+ for analysis, PHP 8.3+ for execution

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

[](#installation)

```
composer install
```

Usage
-----

[](#usage)

### Basic command

[](#basic-command)

```
./bin/changelog-generator /path/to/old/version /path/to/new/version
```

### Available options

[](#available-options)

```
./bin/changelog-generator old-path new-path [options]

Arguments:
  old-path              Path to the old version of the codebase
  new-path              Path to the new version of the codebase

Options:
  -o, --output=OUTPUT            Output file for the changelog [default: "CHANGELOG.md"]
  -c, --current-version=VERSION  Current version number [default: "1.0.0"]
  -i, --ignore=IGNORE            Patterns to ignore (supports wildcards) [default: ["*/vendor/*", "*/tests/*", "*/test/*"]] (multiple values allowed)
  -f, --format=FORMAT            Output format (markdown, json) [default: "markdown"]
      --dry-run                  Show changes without writing to file
      --strict-semver            Use strict SemVer rules (breaking changes = major even for pre-1.0.0)
  -q, --quiet                    Shows only recommended version and/or errors
```

### Examples

[](#examples)

```
# Generate a basic changelog
./bin/changelog-generator ./v1.0.0 ./v1.1.0

# Specify current version and output file
./bin/changelog-generator ./v1.0.0 ./v1.1.0 -v 1.0.0 -o CHANGELOG.md

# Ignore specific folders
./bin/changelog-generator ./v1.0.0 ./v1.1.0 -i "*/vendor/*" -i "*/tests/*" -i "*/examples/*"

# Generate a JSON report
./bin/changelog-generator ./v1.0.0 ./v1.1.0 -f json -o report.json

# Preview without writing to file
./bin/changelog-generator ./v1.0.0 ./v1.1.0 --dry-run

# Use strict SemVer for pre-1.0.0 versions
./bin/changelog-generator ./v0.1.0 ./v0.2.0 --current-version 0.1.0 --strict-semver
```

SemVer Rules
------------

[](#semver-rules)

### **Major** Changes (Breaking Changes)

[](#major-changes-breaking-changes)

- Removed methods/functions
- Incompatible signatures (required parameters added, types changed)
- Removed classes/interfaces
- Modified/removed constants
- Restrictive visibility changes

### **Minor** Changes (Backward Compatible)

[](#minor-changes-backward-compatible)

- New methods/functions/classes
- Optional parameters added
- New implemented interfaces
- New constants

### **Patch** Changes

[](#patch-changes)

- PHPDoc modifications without signature impact
- Internal changes without public API impact

Pre-1.0.0 SemVer Behavior
-------------------------

[](#pre-100-semver-behavior)

**By default**, for versions before 1.0.0 (e.g., 0.x.y), this tool follows a relaxed SemVer approach:

- **Breaking changes** (normally major) are treated as **minor** changes
- **New features** remain **minor** changes
- **Bug fixes** remain **patch** changes

This reflects the common practice that pre-1.0.0 versions are in development and breaking changes are expected.

### Strict SemVer Mode

[](#strict-semver-mode)

Use the `--strict-semver` flag to enforce standard SemVer rules even for pre-1.0.0 versions:

```
# Relaxed mode (default): 0.1.0 + breaking changes = 0.2.0
./bin/changelog-generator ./v0.1.0 ./v0.2.0 --current-version 0.1.0

# Strict mode: 0.1.0 + breaking changes = 1.0.0
./bin/changelog-generator ./v0.1.0 ./v0.2.0 --current-version 0.1.0 --strict-semver
```

PHPDoc Analysis
---------------

[](#phpdoc-analysis)

The tool prioritizes native PHP signature analysis but uses PHPDoc as fallback:

- If PHP signature is typed → uses the signature
- If only PHPDoc is typed → uses PHPDoc
- In case of conflict → logs a warning and uses the signature

Architecture
------------

[](#architecture)

```
src/
├── Model/          # Data models (ApiElement, ApiChange, etc.)
├── Parser/         # PHP parser (nikic/php-parser + PHPDoc)
├── Differ/         # Version comparator
├── Analyzer/       # SemVer analysis
├── Generator/      # Changelog generator
└── Console/        # CLI interface

```

Development
-----------

[](#development)

### Tests

[](#tests)

```
composer test
```

### Code standards

[](#code-standards)

```
composer cs-check  # Check
composer cs-fix    # Fix
```

### Static analysis

[](#static-analysis)

```
composer phpstan
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance85

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~30 days

Recently: every ~52 days

Total

8

Last Release

110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6629923435b40a8f2fe8168111bcb2a5aa7badb38421cdc12ac016969adae08?d=identicon)[xavierleune](/maintainers/xavierleune)

---

Top Contributors

[![xavierleune](https://avatars.githubusercontent.com/u/2320425?v=4)](https://github.com/xavierleune "xavierleune (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/xavierleune-php-changelog-generator/health.svg)

```
[![Health](https://phpackages.com/badges/xavierleune-php-changelog-generator/health.svg)](https://phpackages.com/packages/xavierleune-php-changelog-generator)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M564](/packages/symfony-maker-bundle)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.0M188](/packages/icanhazstring-composer-unused)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M55](/packages/roave-backward-compatibility-check)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

53541.0k3](/packages/jolicode-castor)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)

PHPackages © 2026

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