cubicl/php-sorting

A sorting library for PHP

1.0.0 2019-03-22 08:14 UTC

This package is auto-updated.

Last update: 2019-12-22 10:24:05 UTC


README

Build Status

Implementation of a generic sorting system with an interface definition compatible to the Comparable RFC.

Usage

You have two possible options. Depending on your use case you can implement the Cubicl\Sorting\Comparable interface or use a comparator.

<?php

// with a comparable
$orderedList = $sortManager->sortComparable($unorderedListOfComparable);

// or with a comparator
$orderedList = $sortManager->sortWithComparator($comparator, $unorderedList);