PHPackages                             ztsu/pipe - 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. ztsu/pipe

ActiveLibrary

ztsu/pipe
=========

Pipeline pattern simple implementation

1.0.0(9y ago)0898MITPHPPHP &gt;=5.4.0

Since Apr 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ztsu/pipe)[ Packagist](https://packagist.org/packages/ztsu/pipe)[ RSS](/packages/ztsu-pipe/feed)WikiDiscussions master Synced 2mo ago

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

ztsu/pipe
=========

[](#ztsupipe)

Provides a simple implemenation of a pipeline pattern.

Requirements
------------

[](#requirements)

Supports PHP starting with version 5.4.

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

[](#installation)

```
composer require ztsu/pipe
```

Usage
-----

[](#usage)

Here is a basic usage example:

```
use Ztsu\Pipe\Pipeline;

$a = function ($payload, $next) {
    return $next($payload . "a");
};

$b = function ($payload, $next) {
    return $next($payload . "b");
};

$pipeline = new Pipeline;

$pipeline->add($a);
$pipeline->add($b);

echo $pipeline->run(""); // "ab"
```

Here `$a` and `$b` are callables with two arguments. First is for accumulating a payload from previous stages. Second is for continuing next stages in a pipeline.

For break pipeline just return `$payload` instead of call `$next`:

```
$pipeline = new Pipeline;

$break = function ($payload, $next) {
    return $payload;
};

$pipeline->add($a);
$pipeline->add($break);
$pipeline->add($b);

echo $pipeline(""); // "a"
```

A pipeline is callable too. And it's able to use as a stage.

For this just add it to another pipeline:

```
$pipeline = new Pipeline;

$pipeline->add($a);
$pipeline->add($bc);

echo $pipeline(""); // "abc"
```

If use pipeline with a break as a stage it breaks entire pipeline.

License
-------

[](#license)

MIT.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3574d ago

Major Versions

0.1.1 → 1.0.02016-08-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/3930097a2c0164318282dbee9301e8aece70a99974103231cf597c3a08e4faf0?d=identicon)[ztsu](/maintainers/ztsu)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/ztsu-pipe/health.svg)

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

PHPackages © 2026

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