PHPackages                             bermudaphp/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. [HTTP &amp; Networking](/categories/http)
4. /
5. bermudaphp/pipeline

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bermudaphp/pipeline
===================

PSR-15 middleware pipeline implementation for building composable HTTP request/response processing chains

v2.2(6mo ago)5941MITPHPPHP ^8.4CI failing

Since Jul 14Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/bermudaphp/pipeline)[ Packagist](https://packagist.org/packages/bermudaphp/pipeline)[ RSS](/packages/bermudaphp-pipeline/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (1)

Bermuda Pipeline
================

[](#bermuda-pipeline)

**Bermuda Pipeline** is a lightweight and flexible implementation of the pipeline pattern for PHP applications. It provides a robust mechanism for processing HTTP requests through a chain of middleware components compliant with PSR-7 and PSR-15 standards.

Overview
--------

[](#overview)

Bermuda Pipeline enables you to create a processing pipeline where each middleware receives a ServerRequest, performs its specific handling, and then delegates control to the next middleware in the chain. When the middleware chain is exhausted, a fallback handler is used to generate a response.

The key benefits of using Bermuda Pipeline include:

- **Immutability**: Methods such as `pipe()` return a new pipeline instance with the added middleware, keeping the original pipeline unchanged. This makes it safe for use in complex, multi-threaded, or reentrant scenarios.
- **PSR Compliance**: The implementation is based on PSR-7 and PSR-15 standards, ensuring seamless interoperability with other components in the PHP ecosystem.
- **Deep Cloning**: When cloning a pipeline, each middleware is deeply cloned to avoid shared mutable state, ensuring that changes to one instance do not affect others.
- **Flexible Fallback Handler**: A fallback handler is invoked once all middleware have been executed, ensuring that a default response is always available.

Features
--------

[](#features)

- **IteratorAggregate and Countable Interfaces**: Easily iterate over the middleware chain and retrieve the number of middleware components.
- **Immutability**: The pipeline is designed to be immutable; all modifications (e.g., adding middleware) return a new instance.
- **Deep Cloning**: When a pipeline is cloned, every middleware is cloned as well to prevent shared state issues.
- **Factory Method**: The static method `createFromIterable()` simplifies the instantiation of a pipeline from a list of middleware components.
- **Customizable Fallback Handler**: Use `withFallbackHandler()` to replace the default fallback handler without altering the original pipeline instance.

Requires
--------

[](#requires)

- **PHP:** &gt;= 8.4

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

[](#installation)

You can install Bermuda Pipeline via Composer. Run the following command in your project directory:

```
composer require bermudaphp/pipeline
```

Usage
-----

[](#usage)

```
// Create the pipeline with an array of middleware
$pipeline = new Pipeline([new MyFirstMiddleware(), new MySecondMiddleware]);

// Process the request through the pipeline, resulting in a ResponseInterface instance
$response = $pipeline->handle($request);
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

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 ~214 days

Recently: every ~342 days

Total

10

Last Release

208d ago

Major Versions

v1.2.4 → v2.02025-04-26

PHP version history (4 changes)v1.0PHP &gt;= 7.4

v1.2.2PHP &gt;= 7.4 | &gt;= 8.0

v1.2.3PHP ^7.4|^8.0|^8.1

v2.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

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

---

Tags

chain-of-responsibilityhttpmiddlewaremiddleware-dispatchersmiddleware-pipelinemiddlewaresphpphp-middlewarepipelinepsr-15psr-7httppsr-7middlewarepsr-15pipelinerequest-handlerphp84

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[psr/http-server-middleware

Common interface for HTTP server-side middleware

18091.2M1.5k](/packages/psr-http-server-middleware)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M92](/packages/middlewares-utils)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)

PHPackages © 2026

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