kubik / sorter
Sort library
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kubik/sorter
Requires
- php: >=7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
This package is auto-updated.
Last update: 2025-12-07 21:16:18 UTC
README
This is a PHP Sorting Library can sorts array objects from large to small and from small to large.
Installation
$ composer require kubik/sorter
Usage
Sorting from smaller
$sorter = new Sorter(new SorterFromSmaller()); print_r($sorter->sort($array));
Sorting from large
$sorter = new Sorter(new SorterFromLarge()); print_r($sorter->sort($array));
Switch startegy sorting
$sorter = new Sorter(new SorterFromSmaller()); print_r($sorter->sort($array)); $sorter->setStrategy(new SorterFromLarge()); print_r($sorter->sort($array));
License
This project is released under the terms of the BSD-3-Clause license.
Copyright (c) 2019, Anton Kubrak