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

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

waterloomatt/pipeline
=====================

A simple tool for step-by-step processing.

v0.0.1-alpha(4y ago)0301MITPHP

Since Nov 12Pushed 4y agoCompare

[ Source](https://github.com/waterloomatt/pipeline)[ Packagist](https://packagist.org/packages/waterloomatt/pipeline)[ RSS](/packages/waterloomatt-pipeline/feed)WikiDiscussions main Synced today

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

Pipeline - a simple step-by-step processing tool
================================================

[](#pipeline---a-simple-step-by-step-processing-tool)

[![waterloomatt / pipeline](https://github.com/waterloomatt/pipeline/actions/workflows/php.yml/badge.svg)](https://github.com/waterloomatt/pipeline/actions/workflows/php.yml)

Based on [Laravel's pipeline](https://laravel.com/api/master/Illuminate/Pipeline/Pipeline.html), this little titan performs step-by-step processing over an object - any object.

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

[](#installation)

This package is currently in alpha and you should take care running it in anything beyond toy applications. That said, I have been using this pipeline class in production for well over a year without any issues.

`composer require waterloomatt/pipeline:v0.0.1-alpha`

Overview
--------

[](#overview)

Imagine an event happens in your system, like a CSV file is uploaded, and it triggers some actions,

1. the file is validated (ex. size, extension, mime-type, etc.)
2. file is processed (ex. parsed and extracted into a relational database)
3. file is archived (ex. moved in a remote share)
4. notifications need to be sent (ex. emails are sent to business users and the end-user)

You probably, have some objects that are responsible for each of these steps,

1. a `$validator`
2. a `$processor`
3. an `$archiver`
4. a `$notifier`

Good. And in a traditional OOP application, the calling code would look something like,

```
$validator->validate($file);
$processor->process($file);
$mover->move($file);
$notifier->notify($file);
```

Good. Nothing wrong with that. That logic could live anywhere but in a traditional MVC application it'd probably live in a controller, model, or some auxiliary of those.

Now, how does the pipeline do it?

```
$pipes = [
    $validator,
    $processor,
    $archiver,
    $notifier
];

(new Pipeline())
    ->send($file)
    ->through($pipes)
    ->thenReturn();
```

Yip. It is that simple. Let's look at some examples. We'll start easy and work our way up.

Pipes can be closures
---------------------

[](#pipes-can-be-closures)

```
$pipes = [
    // Multiply by 10
    function ($input, $next) {
        $input = $input * 10;
        return $next($input);
    },

    // Divide by 5
    function ($input, $next) {
        $input = $input / 5;
        return $next($input);
    },

    // Add 1
    function ($input, $next) {
        $input = $input + 1;
        return $next($input);
    },
];

$output = (new Pipeline())
    ->send(10)           // Start with 10
    ->through($pipes)    // Multiply by 10, divide by 5, add 1
    ->thenReturn();

// Output: 21
```

Pipes can be classes
--------------------

[](#pipes-can-be-classes)

```
class Validate
{
    public function handle(File $file, Closure $next)
    {
        // ... business logic ...

        return $next($file);
    }
}

class Process
{
    public function handle(File $file, Closure $next)
    {
        // ... business logic ...

        return $next($file);
    }
}

class Archive
{
    public function handle(File $file, Closure $next)
    {
        // ... business logic ...

        return $next($file);
    }
}

class Notify
{
    public function handle(File $file, Closure $next)
    {
        // ... business logic ...

        return $next($file);
    }
}

$pipes = [
    new Validate(),
    new Process(),
    new Archive(),
    new Notify()
];

(new Pipeline())
    ->send(new File())   // Start with a file
    ->through($pipes)    // validate, process, archive, notify
    ->thenReturn();
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

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

1640d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f7ff61fe2388724dfc0ee2f9be41b3e3e5f89c9b6eecf9e55f3c735daf8970f?d=identicon)[waterloomatt](/maintainers/waterloomatt)

---

Top Contributors

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

---

Tags

processingfunctionalpipelinestep-by-step

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[lstrojny/functional-php

Functional primitives for PHP

2.0k7.3M48](/packages/lstrojny-functional-php)[league/pipeline

A plug and play pipeline implementation.

1.0k16.0M74](/packages/league-pipeline)[nikic/iter

Iteration primitives using generators

1.1k5.9M38](/packages/nikic-iter)[lambdish/phunctional

λ PHP functional library

3612.0M23](/packages/lambdish-phunctional)[ihor/nspl

Non-standard PHP library (NSPL) - functional primitives toolbox and more

381368.5k](/packages/ihor-nspl)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)

PHPackages © 2026

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