PHPackages                             antindehoda/sort-library - 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. antindehoda/sort-library

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

antindehoda/sort-library
========================

Sorting library

02PHP

Since May 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/AntinDehoda/ArraySorter)[ Packagist](https://packagist.org/packages/antindehoda/sort-library)[ RSS](/packages/antindehoda-sort-library/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SortLibrary
===========

[](#sortlibrary)

Library sorting arrays of numbers and arrays of strings. Contains two standard implementations of sorting algorithms: from large to small (`DecreaseSorter`) and from small to large (`IncreaseSorter`). Also implemented the design pattern "Null Object" (`NullObjectSorter`).

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

[](#installation)

To install the library, run this command:

```
$ composer require antindehoda/sort-library

```

Usage
-----

[](#usage)

1. Create the sorting strategy you need.

```
    $increaseStrategy = new IncreaseSorter();
```

2. Create Sorter object

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

3. If you need to change strategy on the fly, you can do it using the method `setStrategy`.

```
    $decreaseStrategy = new DecreaseSorter();
    $sorter->setStrategy($decreaseStrategy);
```

4. Sort the array. The method `sort` of the Sorter object returns a sorted array.

```
    $sorter->sort($array)
```

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) 2019, Anton Degoda

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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://avatars.githubusercontent.com/u/17574632?v=4)[Anton Dehoda](/maintainers/AntinDehoda)[@AntinDehoda](https://github.com/AntinDehoda)

---

Top Contributors

[![AntinDehoda](https://avatars.githubusercontent.com/u/17574632?v=4)](https://github.com/AntinDehoda "AntinDehoda (35 commits)")

### Embed Badge

![Health badge](/badges/antindehoda-sort-library/health.svg)

```
[![Health](https://phpackages.com/badges/antindehoda-sort-library/health.svg)](https://phpackages.com/packages/antindehoda-sort-library)
```

###  Alternatives

[renttek/magento2-virtual-controllers

A module which enables developers to create virtual controllers in Magento 2

303.1k](/packages/renttek-magento2-virtual-controllers)

PHPackages © 2026

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