PHPackages                             mf-miko/sorted-linked-list - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mf-miko/sorted-linked-list

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mf-miko/sorted-linked-list
==========================

A simple type-safe sorted singly linked list for int or string values in PHP.

1.0.0(11mo ago)01MITPHPPHP ^8.0

Since May 25Pushed 11mo agoCompare

[ Source](https://github.com/michal-faltan/sorted-linked-list)[ Packagist](https://packagist.org/packages/mf-miko/sorted-linked-list)[ RSS](/packages/mf-miko-sorted-linked-list/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SortedLinkedList
================

[](#sortedlinkedlist)

A simple, type-safe, sorted singly linked list implementation in PHP supporting `int` or `string` values — but not both in the same list.

Features
--------

[](#features)

- Maintains **ascending order** on every insertion.
- Enforces **single scalar type** (`int` or `string`) throughout the list.
- Supports common list operations:
    - `insert()`
    - `delete()`
    - `deleteAllOf()`
    - `find()`
    - `exists()`
    - `clear()`
    - `toArray()`

Installation
------------

[](#installation)

You can include this class in your project via Composer:

```
composer require mf-miko/sorted-linked-list
```

Usage
-----

[](#usage)

```
use Miko\SortedLinkedList\SortedLinkedList;

$list = new SortedLinkedList();
$list->insert(10);
$list->insert(5);
$list->insert(20);

print_r($list->toArray()); // [5, 10, 20]

$list->delete(10);
print_r($list->toArray()); // [5, 20]

echo $list->exists(5); // true

$list->clear();
```

Type enforcement
----------------

[](#type-enforcement)

First value inserted determines type accepted by particular instance of **SortedLinkedList**. Any future insert of a mismatched type will throw `InvalidArgumentException`. Function clear() resets the type enforcement.

```
$list = new SortedLinkedList();
$list->insert("apple");     // OK
$list->insert("banana");    // OK
$list->insert(42);          // ❌ InvalidArgumentException
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb434e8a23b3680a981c0e1311690fbce17a5ee15649e8ac280d67b9169df305?d=identicon)[mf-miko](/maintainers/mf-miko)

---

Top Contributors

[![michal-faltan](https://avatars.githubusercontent.com/u/40456263?v=4)](https://github.com/michal-faltan "michal-faltan (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mf-miko-sorted-linked-list/health.svg)

```
[![Health](https://phpackages.com/badges/mf-miko-sorted-linked-list/health.svg)](https://phpackages.com/packages/mf-miko-sorted-linked-list)
```

###  Alternatives

[mrgoon/aliyun-sms

阿里云短信服务php调用代码

8292.9k](/packages/mrgoon-aliyun-sms)[carrooi/nette-menu

Menu control for Nette framework

2950.0k1](/packages/carrooi-nette-menu)[misterion/pinba-phpdoc

@phpdoc extension php pinba for IDE autocomplete

1053.4k2](/packages/misterion-pinba-phpdoc)[zalanihir/country-state-city

Laravel package for country, state, city providers with the flags

276.0k](/packages/zalanihir-country-state-city)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
