krixikraxi / sortingalgorithms
Sorting Algorithms for Arrays
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/krixikraxi/sortingalgorithms
Requires (Dev)
- phpunit/phpunit: 5.5.*
 
This package is not auto-updated.
Last update: 2025-10-30 00:45:28 UTC
README
This project was created for improving my PHP skills. Learning PHP debugging unit testing, data structures and the composer.
I created a simple collection with sorting algorithms wrapped in an strategy software design pattern. https://sourcemaking.com/design_patterns/strategy
For generating the autoload files:
composer dump-autoload -o
or a complete update
composer update
Running the Tests:
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/SortingAlgorithmTest
Install via Composer:
Create the composer.json file with this content:
{
  "require": {
    "krixikraxi/sortingalgorithms": "dev-master"
  },
  "minimum-stability": "dev"
}
Run composer install
Usage
use krixikraxi\sortingAlgorithms\Sorter;
require_once __DIR__.'/vendor/autoload.php';
$sorter = new Sorter("InsertionSort");
$sortedArray = $sorter->sort(array(4,1,7));