PHPackages                             jan-maennig/sorty - 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. jan-maennig/sorty

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

jan-maennig/sorty
=================

Library to sort arrays and array objects.

1.1.0(8y ago)42.5k↓43.8%MITPHPPHP &gt;=5.6

Since Nov 1Pushed 8y ago3 watchersCompare

[ Source](https://github.com/janmaennig/sorty)[ Packagist](https://packagist.org/packages/jan-maennig/sorty)[ Docs](https://github.com/janmaennig/sorty)[ RSS](/packages/jan-maennig-sorty/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (10)Versions (7)Used By (0)

Sorty
=====

[](#sorty)

[![Latest Stable Version](https://camo.githubusercontent.com/fff6bfca28edb4777eaea584fd339654e709087670fc4d5ccb43a8dc73d01b8b/68747470733a2f2f706f7365722e707567782e6f72672f6a616e2d6d61656e6e69672f736f7274792f762f737461626c65)](https://packagist.org/packages/jan-maennig/sorty)[![Build Status](https://camo.githubusercontent.com/5346975fe34d8bbde1b8c37c5a253a33c27150d08ebb96d8b9ea03bbecdb57f4/68747470733a2f2f7472617669732d63692e6f72672f6a616e6d61656e6e69672f736f7274792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/janmaennig/sorty)[![Total Downloads](https://camo.githubusercontent.com/27ca1bc0d5c450517d296d33c28fdc1543b6ed7ad59f3040f2e78c6d40a60f8b/68747470733a2f2f706f7365722e707567782e6f72672f6a616e2d6d61656e6e69672f736f7274792f646f776e6c6f616473)](https://packagist.org/packages/jan-maennig/sorty)[![License](https://camo.githubusercontent.com/6809c9a0dbe35c6e803a9f0fd29b270cf35837253d8206e6ee303805e45403e0/68747470733a2f2f706f7365722e707567782e6f72672f6a616e2d6d61656e6e69672f736f7274792f6c6963656e7365)](https://packagist.org/packages/jan-maennig/sorty)[![Test Coverage](https://camo.githubusercontent.com/c2e05f0a0741d39e959c18c923a63d3c78c8fdf16b2af9a7bc69c0cdc9c75cb9/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a616e6d61656e6e69672f736f7274792f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/janmaennig/sorty/coverage)

Sorty provided a library to sort arrays and object storages by multiple properties and directions. Object storages must be implement "\\Iterator" and "\\ArrayAccess" interfaces.

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

[](#installation)

```
composer require jan-maennig/sorty

```

How to use
----------

[](#how-to-use)

### Sort array collection

[](#sort-array-collection)

[examples/example\_array.php](examples/example_array.php)

### Sort a storage of objects

[](#sort-a-storage-of-objects)

[examples/example\_object\_storage.php](examples/example_object_storage.php)

Checks
------

[](#checks)

```
./vendor/bin/phpcs --standard=PSR2 ./src -v
./vendor/bin/phpcpd ./src
./vendor/bin/phpunit ./tests/ --coverage-clover build/logs/clover.xml
./vendor/bin/phpmd ./src text ./phpmd.xml
./vendor/bin/security-checker security:check ./composer.lock

```

Changelog
---------

[](#changelog)

2017-12-04 Jan Maennig

```
* Add functionality to sort object storages

```

2016-11-09 Jan Maennig

```
* Bugfixes
* Add code checks

```

2016-11-01 Jan Maennig

```
* Initial add array value sorter

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~100 days

Total

6

Last Release

3129d ago

Major Versions

0.2.0 → 1.0.02016-11-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/489309b11c13d9b171a7032f04d68800430cae3a56174427b47bbded68ab3cd3?d=identicon)[janmaennig](/maintainers/janmaennig)

---

Top Contributors

[![janmaennig](https://avatars.githubusercontent.com/u/5433846?v=4)](https://github.com/janmaennig "janmaennig (33 commits)")

---

Tags

arraysortingorder

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jan-maennig-sorty/health.svg)

```
[![Health](https://phpackages.com/badges/jan-maennig-sorty/health.svg)](https://phpackages.com/packages/jan-maennig-sorty)
```

###  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)
