PHPackages                             italystrap/pipeline - 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. italystrap/pipeline

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

italystrap/pipeline
===================

A lightweight middleware pipeline for PHP — chain handlers and middleware to process messages through a composable pipeline

049PHPCI passing

Since Apr 7Pushed 2mo agoCompare

[ Source](https://github.com/ItalyStrap/pipeline)[ Packagist](https://packagist.org/packages/italystrap/pipeline)[ RSS](/packages/italystrap-pipeline/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ItalyStrap Pipeline
===================

[](#italystrap-pipeline)

A lightweight, zero-dependency middleware pipeline for PHP.

Route any object through a composable pipeline of middleware before reaching a final handler — inspired by the HTTP middleware pattern (PSR-15).

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

[](#installation)

```
composer require italystrap/pipeline
```

Quick Start
-----------

[](#quick-start)

```
use ItalyStrap\Pipeline\Pipeline;
use ItalyStrap\Pipeline\CallbackHandler;
use ItalyStrap\Pipeline\HandlerInterface;
use ItalyStrap\Pipeline\MiddlewareInterface;

// 1. Define a message (any object mutable or immutable)
$message = new User(name: 'Alice', email: 'alice@example.com');

// 2. Create a pipeline with a handler and middleware
$handler = new Pipeline(
    new CallbackHandler(static function (object $message): string {
        // final handler logic
        return 'User created: ' . $message->name;
    }),
    new LoggingMiddleware(),
    new ValidationMiddleware(),
);

// 3. Dispatch when ready
$result = $handler->handle($message);
```

The message flows through middleware in the order they were provided, then reaches the handler.

Documentation
-------------

[](#documentation)

- **[Overview](docs/01-overview.md)** — Architecture, pattern, and design rationale
- **[Interfaces](docs/02-interfaces.md)** — `HandlerInterface` and `MiddlewareInterface`
- **[Pipeline](docs/03-pipeline.md)** — The main pipeline dispatcher
- **[Helpers](docs/04-helpers.md)** — `CallbackHandler`, `DecorateHandler`, `NoHandlerProvided`
- **[Pipeline vs DecorateHandler](docs/05-pipeline-vs-decorate-handler.md)** — When to use which
- **[Wrapping the Pipeline](docs/06-wrapping-the-bus.md)** — Adapting the generic pipeline to typed contracts (e.g. CLI exit codes)

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance56

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/13d145319a065be260ee79e728655780ddd63002e5ac6c317701c8996ec8d94c?d=identicon)[overclokk](/maintainers/overclokk)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/italystrap-pipeline/health.svg)

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

###  Alternatives

[adfab/m2-module-gdpr

GDPR compatibility

632.2k](/packages/adfab-m2-module-gdpr)

PHPackages © 2026

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