PHPackages                             sourcerer-mike/phpsemver - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. sourcerer-mike/phpsemver

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sourcerer-mike/phpsemver
========================

Compare two version and check for semantic versioning.

3.2.0(10y ago)2774[7 issues](https://github.com/sourcerer-mike/phpsemver/issues)[3 PRs](https://github.com/sourcerer-mike/phpsemver/pulls)1MITPHP

Since Nov 27Pushed 4y agoCompare

[ Source](https://github.com/sourcerer-mike/phpsemver)[ Packagist](https://packagist.org/packages/sourcerer-mike/phpsemver)[ Docs](https://github.com/sourcerer-mike/phpsemver)[ RSS](/packages/sourcerer-mike-phpsemver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (16)Used By (1)

PHPSemVer
=========

[](#phpsemver)

> Check your changes against semantic versions

[![Build Status](https://camo.githubusercontent.com/aa4524c62c014a809c9bf4e01106853497e86826484ef8072413021605d9a5c1/68747470733a2f2f7472617669732d63692e6f72672f736f757263657265722d6d696b652f70687073656d7665722e7376673f6272616e63683d332e322e30)](https://travis-ci.org/sourcerer-mike/phpsemver)[![Coverage](https://camo.githubusercontent.com/89ff2c9f29ccb9f461ed811db38a41cffbde5f145b21a75e4ddb4a7dc712ccb0/68747470733a2f2f636f6465636f762e696f2f6769746875622f736f757263657265722d6d696b652f70687073656d7665722f636f7665726167652e7376673f6272616e63683d332e322e30)](http://codecov.io/github/sourcerer-mike/phpsemver?branch=3.2.0)

Install it via composer

```
composer require sourcerer-mike/phpsemver

```

and test your code by comparing two versions

```
phpsemver compare 3.2.0 HEAD

```

or the last commit with your current work:

```
phpsemver compare HEAD .

+-------+-------------------------------------------------------------------+
| Level | Message                                                           |
+-------+-------------------------------------------------------------------+
| major | phpsemver_get_composer_config() removed.                          |
| major | PHPSemVer\Specification removed.                                  |
| minor | PHPSemVer\Config added.                                           |
| minor | PHPSemVer\Wrapper\AbstractWrapper::mergeTrees() added.            |
| patch | PHPSemVer\Wrapper\Directory::getAllFileNames() body changed.      |
| patch | PHPSemVer\Wrapper\Git::getAllFileNames() body changed.            |
+-------+-------------------------------------------------------------------+

Total time: 0.94

```

You're welcome!

Features
--------

[](#features)

### Commands

[](#commands)

Try the several possibilities:

- Use `compare` to check for changes.
- Use `vcs:message` to enhance your commit messages.

### Wrapper

[](#wrapper)

Choose between those wrapper(`phpsemver compare --type ...`):

- GIT
- Filesystem / Directories

If one argument is a directory, then the system will work on the file system.

### Assertions

[](#assertions)

Make assertions on:

- Functions
    - IsAdded: Check if a function is new.
    - IsRemoved: Check if a function is removed.
    - BodyChanged: Check if someone changed the behaviour of a function.
- Classes
    - IsAdded: Check if a classes is new.
    - IsRemoved: Check if a classes is removed.
- Methods
    - IsAdded: Check if a method is new.
    - IsRemoved: Check if a method is removed.
    - BodyChanged: Check if someone changed the behaviour of a method.
    - ReturnTypeChanged: Watch for changed return types.
    - ReturnTypeRemoved: Watch for incompatible changes on methods.
- Interfaces
    - IsAdded: Check if an interface is new.
    - IsRemoved: Check if an interface is removed.

Combine them as you like in your own configuration file.

Configuration
-------------

[](#configuration)

Configure which assertions are used in a XML-File. The delivered XSD file makes it easy to write your own configuration (in a proper IDE).

```

            @lib/.*@

            @lib/Test/.*@

```

Write your own and use it with the `--ruleset` option. See the wiki entry for more information:

### Prepared rule sets

[](#prepared-rule-sets)

Those projects do semantic versions in different ways. So a special config is written for them which can be used via the `--ruleSet` option:

- Drupal-Core
- SemVer2
- WordPress

Just write `phpsemver --ruleSet Drupal-Core` and see the latest changes in Drupal. There are other companies that follow some semantics in their rules like Symfony. Don't drag behind - catch up with PHPSemVer.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

Established project with proven stability

 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 ~6 days

Recently: every ~11 days

Total

9

Last Release

3777d ago

Major Versions

1.0.1 → 2.0.02015-11-29

1.0.2 → 3.0.02016-01-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/43cfe7528adedb7318b4d1e680eb50ad8cd2a17fd7bc4417359cd0d711bad988?d=identicon)[sourcerer-mike](/maintainers/sourcerer-mike)

---

Top Contributors

[![ScreamingDev](https://avatars.githubusercontent.com/u/2559177?v=4)](https://github.com/ScreamingDev "ScreamingDev (261 commits)")

---

Tags

assertionsphpsemantic-versionstestingStatic code analysiscode analysisCode toolSemantic version

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sourcerer-mike-phpsemver/health.svg)

```
[![Health](https://phpackages.com/badges/sourcerer-mike-phpsemver/health.svg)](https://phpackages.com/packages/sourcerer-mike-phpsemver)
```

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[maglnet/composer-require-checker

CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package

99810.9M671](/packages/maglnet-composer-require-checker)

PHPackages © 2026

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