PHPackages                             robertasproniu/php-sortable-collections - 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. robertasproniu/php-sortable-collections

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

robertasproniu/php-sortable-collections
=======================================

sortable collections of items

014PHP

Since May 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/robertasproniu/php-sortable-collections)[ Packagist](https://packagist.org/packages/robertasproniu/php-sortable-collections)[ RSS](/packages/robertasproniu-php-sortable-collections/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Sortable Collection of Items
============================

[](#sortable-collection-of-items)

An example package that allows to create, merge and sort collections of items.

Collections are sorted using custom algorithm wich can be found in `SortableArray.php` file

**To install use:**

```
composer require robertasproniu/php-sortable-collections dev-master

```

**To run the tests:**

```
./vendor/bin/phpunit
```

---

**Creating a collection**

```
use SortableCollection\Collection\Collection;
$collection = new Collection($items); // where $items = []
```

or using a factory class

```
use SortableCollection\CollectionFactory;
use SortableCollection\Collection\Collection;

class CustomCollectionFactory extends CollectionFactory
{
    public static function create($items) : CollectionInterface
    {
        // do whatever you need

        return new Collection($items);
    }
}

$collection = CustomCollectionFactory::create($data);
```

**Get items from collection**

```
$collection->get(); // return array
```

**Remove duplicate values from a collection**

```
$collection->unique();
```

**Sort collection values**

```
$collection->sort(function($value1, $value2){
    //conditions
});
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a8da193a37b7b0e1493d17401c51b6fdae1e7cb27a88fcad169bb041a20a100?d=identicon)[robert.asproniu](/maintainers/robert.asproniu)

---

Top Contributors

[![robertasproniu](https://avatars.githubusercontent.com/u/12408478?v=4)](https://github.com/robertasproniu "robertasproniu (12 commits)")

### Embed Badge

![Health badge](/badges/robertasproniu-php-sortable-collections/health.svg)

```
[![Health](https://phpackages.com/badges/robertasproniu-php-sortable-collections/health.svg)](https://phpackages.com/packages/robertasproniu-php-sortable-collections)
```

###  Alternatives

[prism-php/relay

A Prism tool for interacting with MCP servers

15236.1k3](/packages/prism-php-relay)[ruafozy/mersenne-twister

Pure-PHP Mersenne Twister

221.4M12](/packages/ruafozy-mersenne-twister)[writecrow/lemmatizer

A non-part-of-speech lemmatizer tool

13183.1k2](/packages/writecrow-lemmatizer)

PHPackages © 2026

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