PHPackages                             gideonazure/array\_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. gideonazure/array\_sorter

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

gideonazure/array\_sorter
=========================

This is package for sorting array of numbers and strings

v1.0.2(5y ago)04MITPHPPHP &gt;=7.4

Since Aug 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gideonazure/php_sorter)[ Packagist](https://packagist.org/packages/gideonazure/array_sorter)[ RSS](/packages/gideonazure-array-sorter/feed)WikiDiscussions master Synced 6d ago

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

Array sorter
============

[](#array-sorter)

This project based on a "default-project" structure package for PHP projects and help sort array of numbers or strings.

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

[](#installation)

Use the composer [package](https://packagist.org/packages/gideonazure/array_sorter) to install class serializer.

```
composer require gideonazure/array_sorter
```

Usage
-----

[](#usage)

```
// require needed class to your project
use \ArraySorter\StringSorter;
use \ArraySorter\AscStringArraySorter;
use \ArraySorter\DescStringArraySorter;
use \ArraySorter\NumericSorter;
use \ArraySorter\AscNumericArraySorter;
use \ArraySorter\DescNumericArraySorter;
use \ArraySorter\Exception\ValidArrayTypeException;
use \ArraySorter\Exception\ValidDataException;

// Create instance of a class...

// ...for sort numeric array data
$numeric = new NumericSorter();

// ...for sort strings array data
$string = new StringSorter();

// set an instance of a class implementing sort direction as a property for numeric arrays
$numeric->setDirection(new AscNumericArraySorter()); // for ascending sorting
$numeric->setDirection(new DescNumericArraySorter()); // for descending sorting

// set an instance of a class implementing sort direction as a property for strings arrays
$string->setDirection(new AscStringArraySorter()); // for ascending sorting
$string->setDirection(new DescStringArraySorter()); // for descending sorting

// and then call  "sort" method of instance
// with passing array data

// return numeric arrays
$result = $numeric->sort(/* numeric array data */);

// return strings array
$result = $string->sort(/* strings array data  */);

// if need catch errors and return message use try->catch construction:
try {
    $result = $string->sort($stringArray);
} catch (ValidDataException $e){
    echo $e->getMessage();
} catch (ValidArrayTypeException $e) {
    echo $e->getMessage();
}
```

Demo
----

[](#demo)

For demo use and check the functionality - run the file "SorterTest.php" from the "/tests" folder

```
php SorterTest.php
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

3

Last Release

2092d ago

### Community

Maintainers

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

---

Top Contributors

[![gideonazure](https://avatars.githubusercontent.com/u/31158436?v=4)](https://github.com/gideonazure "gideonazure (7 commits)")

---

Tags

arraystringsstructureprojectnumberssorting

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[league/config

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

564302.2M24](/packages/league-config)[topshelfcraft/supersort

...a super-duper sorting function for your Craft templates.

4287.1k1](/packages/topshelfcraft-supersort)[lezhnev74/pasvl

Array Validator (regular expressions for nested array, sort of)

5253.7k3](/packages/lezhnev74-pasvl)[graze/sort

A collection of array sorting transforms and functions

12289.6k2](/packages/graze-sort)[graze/data-structure

Data collections and containers

12287.4k8](/packages/graze-data-structure)

PHPackages © 2026

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