siva01 / sorted-linked-list
A sorted linked list implementation in PHP
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/siva01/sorted-linked-list
Requires
- php: >=8.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2025-12-25 14:59:37 UTC
README
This is a library for sorting values into lists based on value type. Currently, there are only two TypeHandlers: integer and string. If you need to sort another data type, create a TypeHandler for your data type.
How to Use:
composer require siva01/sorted-linked-list
Example code:
use SortedLinkedList\Service\ListSorterService; $sorter = new ListSorterService(); $sorter->addToList(1); $sorter->addToList("Apple"); $integerList = $sorter->loadList('integer'); $intValues = $integerList->getValues('ASC'); $stringList = $sorter->loadList('string'); $stringValues = $stringList->getValues('ASC'); $item = $sorter->getItemByValue('Apple'); $prevItem = $item->getPrev(); $nextItem = $item->getNext();
More examples can be found in: /docs/examples/basic_usage.php
Composer Commands
composer cs– Code style checkscomposer test– Unit testscomposer analyse– PHPStan analysis