PHPackages                             codecounter/versionmatcher - 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. codecounter/versionmatcher

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

codecounter/versionmatcher
==========================

1.0(7y ago)19MITPHPPHP ^7.1

Since Dec 7Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

VersionMatcher
==============

[](#versionmatcher)

[![Build Status](https://camo.githubusercontent.com/5ef40a04b7f8a9509e95d9b2f0219774c3d206071d3b2012560cf4272ccb8c90/68747470733a2f2f7472617669732d63692e636f6d2f636f6465636f756e7465722f56657273696f6e4d6174636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/codecounter/VersionMatcher)

Compare versions with logic opertation. (Actually, it's a project to test ci/cd)

Installation
============

[](#installation)

1. With composer

```
{
    ...
    "require": {
        "codecounter/versionmatcher": "0.1.0"
    }
}

```

2. Without composer

```
require "/path/to/VersionMatcher/autoload.php"
```

Usage
=====

[](#usage)

1. Compare 2 version strings

```
// produce `false`
\CodeCounter\VersionMatcher::test('ver >= 1.2.0', array(
    'ver' => '1.1.0'
));
```

2. Compare with logic

```
// produce `true`
\CodeCounter\VersionMatcher::test('ver >= 1.2.0 && ver < 1.6.0', array(
    'ver' => '1.3.0'
));
```

3. Persisted object

```
$matcher = new \CodeCounter\VersionMatcher(array(
    'android' => '1.3.0',
    'ios' => ''
));
// produce `true`
$matcher->match('ios >= 1.4.0 || android >= 1.3.0');
// produce `false`
$matcher->match('ios >= 1.4.0 || android < 1.2.0');
```

For detailed usage, please view `tests` directory.

Develop
=======

[](#develop)

- Clone repository
- `cd dev`
- `cp docker-compose.example.yml docker-compose.yml`, modify it if necessary
- `docker-compose up -d`
- `docker-compose exec php bash`, ssh to the container
- `cd /var/www`

then, you can run unit test by `phpunit`, or code sniffer by `phpcs`.

`php tests/coverage-check.php` after `phpunit`, this script can exit stdout with 1 when coverage &lt; 90%, for ci notification.

License
=======

[](#license)

This library is under MIT license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2717d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/030a3499da596715f5efc32a0b0390914c9e006876433465999ceab504e1a5ba?d=identicon)[codecounter](/maintainers/codecounter)

---

Top Contributors

[![codecounter](https://avatars.githubusercontent.com/u/10571656?v=4)](https://github.com/codecounter "codecounter (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codecounter-versionmatcher/health.svg)

```
[![Health](https://phpackages.com/badges/codecounter-versionmatcher/health.svg)](https://phpackages.com/packages/codecounter-versionmatcher)
```

###  Alternatives

[yiidoc/yii2-redactor

Extension redactor for Yii2 Framework.

191618.8k47](/packages/yiidoc-yii2-redactor)[rias/statamic-color-swatches

1617.2k](/packages/rias-statamic-color-swatches)

PHPackages © 2026

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