PHPackages                             michaelpetri/php-generic-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. michaelpetri/php-generic-list

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

michaelpetri/php-generic-list
=============================

Basic generic list with psalm support

0.2.1(2y ago)111.8k2[1 issues](https://github.com/michaelpetri/php-generic-list/issues)[1 PRs](https://github.com/michaelpetri/php-generic-list/pulls)1MITPHPPHP ~8.1.0 || ~8.2.0CI failing

Since Feb 6Pushed 2w ago2 watchersCompare

[ Source](https://github.com/michaelpetri/php-generic-list)[ Packagist](https://packagist.org/packages/michaelpetri/php-generic-list)[ RSS](/packages/michaelpetri-php-generic-list/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (4)Versions (14)Used By (1)

PHP Generic List
================

[](#php-generic-list)

[![Type Coverage](https://camo.githubusercontent.com/b92d38abf2f83a663d9aac412e1feeb94cd0f331dc998edfaade45abe38aaf81/68747470733a2f2f73686570686572642e6465762f6769746875622f6d69636861656c70657472692f7068702d67656e657269632d6c6973742f636f7665726167652e737667)](https://shepherd.dev/github/michaelpetri/php-generic-list)[![Latest Stable Version](https://camo.githubusercontent.com/70b7880f8f038a885d94be8dec71347abf5bd424389d31d9e0ccc08b05ae0b17/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f7068702d67656e657269632d6c6973742f76)](https://packagist.org/packages/michaelpetri/php-generic-list)[![License](https://camo.githubusercontent.com/c5963593a3b2463a245efc75c55cb8bc1aea18955340ebd383097d2e8c9df011/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f7068702d67656e657269632d6c6973742f6c6963656e7365)](https://packagist.org/packages/michaelpetri/php-generic-list)

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

[](#installation)

```
composer require michaelpetri/php-generic-list
```

Usage
-----

[](#usage)

```
ImmutableList::of(1, 2, 3, 4, 5)
    ->filter(
        static fn(int $i): bool => 0 === $i % 2
    )
    ->map(
        static fn(int $i): int => 2 ** $i
    )
    ->with(
        32
    )
    ->with(
        32
    )
    ->unique()
    ->each(
        static function (int $i): void { sprintf("\d\n", $i) }
    )

// Output:
// 4
// 16
// 32
```

Available methods
-----------------

[](#available-methods)

- `map`
- `filter`
- `each`
- `toArray`

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance43

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.3% 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

Every ~78 days

Total

4

Last Release

1008d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4114292?v=4)[Michael Petri](/maintainers/michaelpetri)[@michaelpetri](https://github.com/michaelpetri)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (100 commits)")[![michaelpetri](https://avatars.githubusercontent.com/u/4114292?v=4)](https://github.com/michaelpetri "michaelpetri (11 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

php

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/michaelpetri-php-generic-list/health.svg)

```
[![Health](https://phpackages.com/badges/michaelpetri-php-generic-list/health.svg)](https://phpackages.com/packages/michaelpetri-php-generic-list)
```

PHPackages © 2026

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