1blankz7 / php-sorting
This package is abandoned and no longer maintained.
The author suggests using the cubicl/php-sorting package instead.
A sorting library for PHP
2.0.0
2023-06-02 15:26 UTC
Requires
None
Requires (Dev)
- phpspec/prophecy-phpunit: ^2.0.2
- phpstan/phpstan: ^1.10.15
- phpunit/phpunit: ^9.6.8
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2023-06-02 15:27:46 UTC
README
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);