mathalubos / sorted-linked-list
A sorted linked list implementation in PHP.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/mathalubos/sorted-linked-list
Requires
- php: ^8.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2025-12-29 17:42:34 UTC
README
A sorted linked list implementation in PHP with support for int and string elements and customizable sort order defaulting to ASC.
Installation
composer require mathalubos/sorted-linked-list
Usage
use Mathalubos\SortedLinkedList\Enum\SortEnum; use Mathalubos\SortedLinkedList\IntSortedLinkedList; $sortedLinkedList = new IntSortedLinkedList(SortEnum::ASC); $sortedLinkedList->add(5); $sortedLinkedList->add(3); $sortedLinkedList->add(7); foreach ($sortedLinkedList as $item) { echo $item; } // outputs: 3, 5, 7
Coding standards
- To check coding standards, run commands:
./vendor/bin/php-cs-fixer fix./vendor/bin/phpstan analyse
Tests
- To run all tests execute:
./vendor/bin/phpunit tests