PHPackages                             phpexperts/composer-constraints-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpexperts/composer-constraints-parser

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

phpexperts/composer-constraints-parser
======================================

A clean-room implementation of Composer's version constraints parser.

v1.0.0(1y ago)04MITPHPPHP &gt;=8.1

Since Apr 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PHPExpertsInc/ComposerConstraintsParser)[ Packagist](https://packagist.org/packages/phpexperts/composer-constraints-parser)[ Docs](https://www.phpexperts.pro/)[ RSS](/packages/phpexperts-composer-constraints-parser/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Composer Constraints Parser
===========================

[](#composer-constraints-parser)

Composer Constraints Parser is a PHP Experts, Inc., Project that is a clean-room implementation of Packagist's composer's version constraint system.

It is meant as a zero-dependency option to faithfully interpret whether any particular version number is satisfiable by a composer verison constraint.

NOTE: 95% of this code was generated by the autonomous AI agents of Autonomo, by Autonomous Programming, LLC. See

This project contains 100% of all of the in-the-world composer version constraints of every dependency of every package in the entire packagist.org database. These can be found in \[tests/constraints.json\].

There are 155,623 test assertions testing all 48,209 in-the-wild composer version constraints and has 100% fidelity. It is current as of 2025-04-01.

This is possible because of the Bettergist Collector API, which archives every PHP packagist package weekly and does deep analysis of them quarterly.

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

[](#installation)

Via Composer

```
composer require phpexperts/composer-version-parser
```

Usage
-----

[](#usage)

```
use PHPExperts\ComposerVersionConstraints\ComposerConstraintsHelper;

$satisfies = ComposerConstraintsHelper::versionSatisfies('7.4', '^7.4|^8.0');
// true
```

Use cases
---------

[](#use-cases)

✔ Can determine if a constraint is valid
✔ Complex composer constraints
✔ All composer constraints
✔ Known constraint

Testing
-------

[](#testing)

```
phpunit
```

Contributors
------------

[](#contributors)

[Theodore R. Smith](https://www.phpexperts.pro/%5D)
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License
-------

[](#license)

MIT license. Please see the [license file](LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance48

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a2dd16766f6b03c330e65aaca9dfb97f1bbbb41c5e2af5681f58f670b7917?d=identicon)[hopeseekr](/maintainers/hopeseekr)

---

Top Contributors

[![hopeseekr](https://avatars.githubusercontent.com/u/1125541?v=4)](https://github.com/hopeseekr "hopeseekr (16 commits)")

---

Tags

composersemverversion constraints

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpexperts-composer-constraints-parser/health.svg)

```
[![Health](https://phpackages.com/badges/phpexperts-composer-constraints-parser/health.svg)](https://phpackages.com/packages/phpexperts-composer-constraints-parser)
```

###  Alternatives

[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M63](/packages/jean85-pretty-package-versions)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.0M188](/packages/icanhazstring-composer-unused)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[composer/metadata-minifier

Small utility library that handles metadata minification and expansion.

181115.0M13](/packages/composer-metadata-minifier)[shipmonk/composer-dependency-analyser

Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)

6076.7M435](/packages/shipmonk-composer-dependency-analyser)

PHPackages © 2026

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