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

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

innmind/stack
=============

Helper to build stacks

1.2.0(5y ago)01.5k↓50%[1 issues](https://github.com/Innmind/Stack/issues)4MITPHPPHP ~7.2|~8.0

Since Apr 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Innmind/Stack)[ Packagist](https://packagist.org/packages/innmind/stack)[ Docs](http://github.com/Innmind/Stack)[ RSS](/packages/innmind-stack/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (2)Versions (5)Used By (4)

Stack
=====

[](#stack)

[![codecov](https://camo.githubusercontent.com/405b6c16dc073266db1f85cfc16724c0a2db2349b13d840541032b298582cc88/68747470733a2f2f636f6465636f762e696f2f67682f496e6e6d696e642f537461636b2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Innmind/Stack)[![Build Status](https://github.com/Innmind/Stack/workflows/CI/badge.svg?branch=master)](https://github.com/Innmind/Stack/actions?query=workflow%3ACI)[![Type Coverage](https://camo.githubusercontent.com/fc00a0940d109389be2a51cf6ebbb23137e607ac1e8534db527e4a12308e939b/68747470733a2f2f73686570686572642e6465762f6769746875622f496e6e6d696e642f537461636b2f636f7665726167652e737667)](https://shepherd.dev/github/Innmind/Stack)

Simple function to stack elements on top of each others. Useful to create object stacks.

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

[](#installation)

```
composer require innmind/stack
```

Usage
-----

[](#usage)

```
use function Innmind\Stack\stack;

$decorate = stack(
    static function(RequestHandler $handler) {
        return new ValidateRequest($handler);
    },
    static function(RequestHandler $handler) {
        return new Security($handler);
    }
);
$handler = $decorate(new MyRequestHandler);
```

The above example is equivalent to:

```
$handler = new ValidateRequest(
    new Security(
        new MyRequestHandler
    )
);
```

**Note**: the classes uses do not exist, they're only meant as an example.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

Every ~330 days

Total

3

Last Release

1915d ago

PHP version history (2 changes)1.0.0PHP ~7.2

1.2.0PHP ~7.2|~8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (22 commits)")

---

Tags

builderstack

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[kris/laravel-form-builder

Laravel form builder - symfony like

1.7k2.2M45](/packages/kris-laravel-form-builder)[gherkins/regexpbuilderphp

PHP port of thebinarysearchtree/regexpbuilderjs

1.4k163.0k1](/packages/gherkins-regexpbuilderphp)[optimistdigital/nova-menu-builder

This Laravel Nova package allows you to create and manage menus and menu items.

243369.4k](/packages/optimistdigital-nova-menu-builder)[outl1ne/nova-menu-builder

This Laravel Nova package allows you to create and manage menus and menu items.

243246.0k3](/packages/outl1ne-nova-menu-builder)[lara-zeus/bolt

Zeus Bolt is form builder for your users, with so many use cases

23640.2k2](/packages/lara-zeus-bolt)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)

PHPackages © 2026

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