PHPackages                             componenta/priority-list - 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. componenta/priority-list

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

componenta/priority-list
========================

Priority ordered list with optional value validation

v1.0.0(1mo ago)091MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/priority-list)[ Packagist](https://packagist.org/packages/componenta/priority-list)[ RSS](/packages/componenta-priority-list/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

Componenta Priority List
========================

[](#componenta-priority-list)

Priority-ordered collection with optional value validation.

Use it for middleware lists, resolver chains, event listeners, plugin hooks, and any ordered registry where equal priorities must keep insertion order.

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

[](#installation)

```
composer require componenta/priority-list
```

Related Packages
----------------

[](#related-packages)

This package is standalone.

PackageWhy it may be used nearby`componenta/event`Event listener priority uses the same ordering model.`componenta/pipeline`Middleware lists can be ordered before pipeline construction.`componenta/di`Resolver/provider chains can be registered with priorities.Usage
-----

[](#usage)

```
use Componenta\Stdlib\PriorityList;

$list = PriorityList::ofStrings()
    ->insert('low', 10)
    ->insert('high', 100);

$list->extract(); // "high"
```

The default order is descending priority. Equal priorities keep insertion order.

```
$list->asc();  // lowest priority first
$list->desc(); // highest priority first
```

Validation
----------

[](#validation)

Factory methods restrict accepted values:

- `ofStrings()`
- `ofInts()`
- `ofFloats()`
- `ofBools()`
- `ofArrays()`
- `ofObjects()`
- `ofCallables()`
- `of(SomeClass::class)`

Custom validators can be passed to the constructor. Rejected values throw `InvalidArgumentException` on `insert()`.

Iteration
---------

[](#iteration)

`PriorityList` implements:

- `IteratorAggregate`
- `Countable`
- `Componenta\Arrayable\Arrayable`

Iteration sorts lazily. The list marks itself dirty on insert/order changes and sorts only before iteration, extraction, or `each()`.

`getIterator()` yields priority as key by default. `toArray()` returns items with both value and priority.

Mutability
----------

[](#mutability)

The collection is mutable. Methods such as `insert`, `asc`, `desc`, `order`, and `clear` mutate the current list and return it for fluent usage.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/componenta-priority-list/health.svg)

```
[![Health](https://phpackages.com/badges/componenta-priority-list/health.svg)](https://phpackages.com/packages/componenta-priority-list)
```

###  Alternatives

[hughgrigg/php-business-time

Business time / working days extension for Carbon dates

3330.5k](/packages/hughgrigg-php-business-time)[tu6ge/voyager-excel

voyager excel export hook

215.0k](/packages/tu6ge-voyager-excel)

PHPackages © 2026

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