siva01/sorted-linked-list

There is no license information available for the latest version (dev-master) of this package.

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

dev-master 2025-05-25 13:41 UTC

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 checks
  • composer test – Unit tests
  • composer analyse – PHPStan analysis