PHPackages                             fev/sorter - 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. fev/sorter

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

fev/sorter
==========

Simple library for sorting arrays.

v2.0.1(5y ago)05BSD-3-ClausePHPPHP &gt;=7.4

Since Aug 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/FEV-soft/sorter)[ Packagist](https://packagist.org/packages/fev/sorter)[ RSS](/packages/fev-sorter/feed)WikiDiscussions master Synced today

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

Simple library for sorting arrays.
==================================

[](#simple-library-for-sorting-arrays)

This library provide two methods (ascending, descending) for sorting arrays.

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

[](#installation)

For install this library just execute the following command

```
$ composer require fev/sorter
```

Usage
-----

[](#usage)

For usage this library you need:

1. Create object form basic class `Sorter`

```
$sorter = new Sorter();
```

2. Define 1 form 2 default sorting methods `SortingABC`, `SortingCBA` by method `setSortingMethod`

```
$sorter->setSortingMethod(new SortingABC());
```

or

```
$sorter->setSortingMethod(new SortingCBA());
```

```
2.1 If you not define sorting methods, then class will be work by default mode like null object pattern.

```

3. Use `sort` method for sorting your array.

```
$sorter->sort($test_arr);
```

Extension
---------

[](#extension)

For extended this library with own sorting rules create new sorting class which implement `SorterInterface` with method `sort()`

Tests
-----

[](#tests)

You can run tests with next command

`$ php test.php`.

License
-------

[](#license)

[![license](https://camo.githubusercontent.com/e39f59f18c324eedeb898bc6f9efabb974f3b63acfcfb70e847532d901fe7329/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f67726565666c61732f64656661756c742d70726f6a6563742e737667)](LICENSE)

This project is released under the terms of the BSD-3-Clause [license](LICENSE).

Copyright (c) 2020, FEV

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

2

Last Release

2138d ago

Major Versions

v1.0.0 → v2.0.12020-08-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/69251083?v=4)[FEV-soft](/maintainers/FEV-soft)[@FEV-soft](https://github.com/FEV-soft)

---

Top Contributors

[![FEV-soft](https://avatars.githubusercontent.com/u/69251083?v=4)](https://github.com/FEV-soft "FEV-soft (2 commits)")

---

Tags

arraysorting

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fev-sorter/health.svg)

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

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k430.2M1.4k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k317.3M3.2k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

565335.0M36](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k13.2M174](/packages/cuyz-valinor)[openlss/lib-array2xml

Array2XML conversion library credit to lalit.org

31053.8M53](/packages/openlss-lib-array2xml)

PHPackages © 2026

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