PHPackages                             pccomponentes/lexicographic-ranking - 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. pccomponentes/lexicographic-ranking

ActiveLibrary

pccomponentes/lexicographic-ranking
===================================

Lexicographic order calculator, useful for persisting ordered lists.

v0.0.5(5y ago)35.4kMITPHPPHP &gt;=7.4

Since Nov 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/PcComponentes/lexicographic-ranking)[ Packagist](https://packagist.org/packages/pccomponentes/lexicographic-ranking)[ RSS](/packages/pccomponentes-lexicographic-ranking/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

Lexicographic Ranking
=====================

[](#lexicographic-ranking)

Lexicographic order calculator, useful for persisting ordered lists.

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

[](#installation)

Install via [composer](https://getcomposer.org/)

```
composer require pccomponentes/lexicographic-ranking
```

Usage
-----

[](#usage)

```
$calculator = new RankingCalculator(
    new Alpha36TokenSet(),
    new DynamicMidPosition()
);

echo $calculator->between('A', 'B');   // AU
echo $calculator->between('F6', 'Z');  // P
echo $calculator->between('FB', 'FW'); // FL
echo $calculator->between(null, '7');  // 3
echo $calculator->between(null, null); // U
```

Config options
--------------

[](#config-options)

### Token sets

[](#token-sets)

The char pool to create the rankings. The following are available:

```
NumericTokenSet (0-9)
Alpha36TokenSet (0-9 and A-Z)
Alpha62TokenSet (0-9 and A-z)

```

To create a custom one extend from TokenSet.

### Position

[](#position)

The space to be left between ranks. The following modes are available:

```
FixedStartPosition  // Leaves a fixed amount of spaces after the first input
FixedEndPosition    // Leaves a fixed amount of spaces before the second input
DynamicMidPosition  // Leaves the same space before and after the result

```

To create a custom one implement Position.

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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

Total

5

Last Release

1879d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c4eb3322c15a9344e9c086a7de11c3204bf5aab5321b562bf9193f5ee8cd420?d=identicon)[zoilomora](/maintainers/zoilomora)

![](https://avatars.githubusercontent.com/u/1301633?v=4)[José Gilberto Mullor](/maintainers/jgmullor)[@jgmullor](https://github.com/jgmullor)

![](https://www.gravatar.com/avatar/2ae3c9248d4074b98971b2701eb581a71567f8c1484d23b29ee85b32075e2deb?d=identicon)[adnanmula](/maintainers/adnanmula)

---

Top Contributors

[![adnanmula](https://avatars.githubusercontent.com/u/33516302?v=4)](https://github.com/adnanmula "adnanmula (43 commits)")

---

Tags

lexorankordering

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pccomponentes-lexicographic-ranking/health.svg)

```
[![Health](https://phpackages.com/badges/pccomponentes-lexicographic-ranking/health.svg)](https://phpackages.com/packages/pccomponentes-lexicographic-ranking)
```

PHPackages © 2026

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