PHPackages                             janderson/tiny-stack - 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. janderson/tiny-stack

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

janderson/tiny-stack
====================

A tiny middleware stack dispatcher

v0.1(3mo ago)04↓90%MITPHPCI passing

Since Mar 30Pushed 3mo agoCompare

[ Source](https://github.com/jdpanderson/tiny-stack)[ Packagist](https://packagist.org/packages/janderson/tiny-stack)[ RSS](/packages/janderson-tiny-stack/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

tiny-stack
==========

[](#tiny-stack)

A tiny middleware stack dispatcher for PHP.

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

[](#installation)

```
composer require janderson/tiny-stack
```

Usage
-----

[](#usage)

Middlewares must implement a function signature compatible with:

```
function(callable $next, array &$envelope, mixed ...$args): mixed
```

A minimal example:

```
use function Janderson\TinyStack\stack;

$trim  = fn($next, &$envelope, $input) => $next(trim($input));
$upper = fn($next, &$envelope, $input) => $next(strtoupper($input));

$stack = stack($trim, $upper);
echo $stack(' Hello, world! '); // "HELLO, WORLD!"
```

### Middleware Rules

[](#middleware-rules)

- Each middleware calls `$next` and returns its result (or its own value).
- Pass arguments to `$next` to mutate them; omit them to preserve the originals.
- The `$envelope` array is shared across all middlewares for passing state.
- Without a terminal middleware, the stack returns a single argument as-is or multiple arguments as an array.

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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

92d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/186284?v=4)[Janderson FFerreira](/maintainers/janderson)[@Janderson](https://github.com/Janderson)

---

Top Contributors

[![jdpanderson](https://avatars.githubusercontent.com/u/4468291?v=4)](https://github.com/jdpanderson "jdpanderson (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/janderson-tiny-stack/health.svg)

```
[![Health](https://phpackages.com/badges/janderson-tiny-stack/health.svg)](https://phpackages.com/packages/janderson-tiny-stack)
```

###  Alternatives

[aaronvangeffen/awstatsparser

A series of classes to help read and merge Awstats data files

112.9k](/packages/aaronvangeffen-awstatsparser)

PHPackages © 2026

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