PHPackages                             konekod/evenly-distribute - 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. konekod/evenly-distribute

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

konekod/evenly-distribute
=========================

Universal service for even distribution of anything

1.0.0(1y ago)06LGPL-3.0-onlyPHPPHP &gt;=8.3

Since Jun 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/KoNekoD/evenly-distribute)[ Packagist](https://packagist.org/packages/konekod/evenly-distribute)[ RSS](/packages/konekod-evenly-distribute/feed)WikiDiscussions main Synced 1mo ago

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

Evenly Distribute Service
=========================

[](#evenly-distribute-service)

Universal service for even distribution of anything

Features
--------

[](#features)

- Sort by distinct by field nonUniqueEntityId
- Distribute evenly by the values defined in pool Id.
- - (strips each element of pool id and builds an array with unique local pool id)

Usage
-----

[](#usage)

```
// See EvenlyDistributeServiceTest::testExampleWorksFine

$input = [
        ['poolId' => 'A', 'uniqueEntityId' => '123', 'nonUniqueEntityId' => 1, 'entity' => ['id' => 123]],
        ['poolId' => 'B', 'uniqueEntityId' => '456', 'nonUniqueEntityId' => 2, 'entity' => ['id' => 456]],
        ['poolId' => 'B', 'uniqueEntityId' => '678', 'nonUniqueEntityId' => 2, 'entity' => ['id' => 678]],
];

$output = EvenlyDistributeService::distributeByPools($input);

$excepted = [
    'A' => [
        ['poolId' => 'A', 'uniqueEntityId' => '123', 'nonUniqueEntityId' => 1, 'entity' => ['id' => 123]]
    ],
    'B' => [
        ['poolId' => 'B', 'uniqueEntityId' => '456', 'nonUniqueEntityId' => 2, 'entity' => ['id' => 456]]
    ],
];

echo $excepted === $output;
```

Testing
-------

[](#testing)

```
# Run phpunit
vendor/bin/phpunit tests

# PhpStan
composer run phpstan
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

698d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce1e92f1d31876dc04de50aa3103f0501deb7f537e039bf7c27d3a398c21b5a5?d=identicon)[KoNekoD](/maintainers/KoNekoD)

---

Top Contributors

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

---

Tags

sortgroupdistributeevenly

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/konekod-evenly-distribute/health.svg)

```
[![Health](https://phpackages.com/badges/konekod-evenly-distribute/health.svg)](https://phpackages.com/packages/konekod-evenly-distribute)
```

###  Alternatives

[kyslik/column-sortable

Package for handling column sorting in Laravel 6.x

6485.6M21](/packages/kyslik-column-sortable)[mottie/tablesorter

tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.

2.6k223.5k](/packages/mottie-tablesorter)[icecave/parity

A customizable deep comparison library.

516.8M10](/packages/icecave-parity)[symbiote/silverstripe-gridfieldextensions

A collection of useful grid field components

971.8M235](/packages/symbiote-silverstripe-gridfieldextensions)[undefinedoffset/sortablegridfield

Adds drag and drop functionality to Silverstripe's GridField

941.2M50](/packages/undefinedoffset-sortablegridfield)[jakezatecky/array_group_by

A function that groups/splits an array by the values of a given key or keys.

100188.7k2](/packages/jakezatecky-array-group-by)

PHPackages © 2026

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