alexmazorchuk/sorter-test

This is a test sorter library for array, integer or rows in PHP .

v1.0.0 2019-10-21 23:03 UTC

This package is auto-updated.

Last update: 2024-03-24 02:31:51 UTC


README

This is a test sorting library for PHP.

Installation

For using this library run execute the following command

$ composer require alexmazorchuk/sorter-test

Usage

<?php

use Alexmazorchuk\Sorter;
use Alexmazorchuk\Sorter\Strategy\AscSort;
use Alexmazorchuk\Sorter\Strategy\DescSort;
use Alexmazorchuk\Sorter\Strategy\NullObject;

$ascSort = new Sorter(new AscSort());
$descSort = new Sorter(new DescSort());
$nullSort = new Sorter(new NullObject());


$ascSortArray = $ascSort->sort($testArray);
$descSortArray = $descSort->sort($testArray);

// NullSorter
$array = $nullSort->sort($testArray); 

Code style fixer

To check the code style just run the following command

$ composer cs-check

to fix the code style run next command

$ composer cs-fix

License

license

This library is released under the terms of the MIT license.

Copyright (c) 2019, Alex