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

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

sergiors/pipeline
=================

Compose sequence of operations, immutable without side-effects

2.0.0(9y ago)1940MITPHP ^7.0

Since Jul 1Compare

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

READMEChangelogDependencies (7)Versions (3)Used By (0)

Pipeline
--------

[](#pipeline)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bee59515cf1145d1c3a44a23e5f4c42f079f569ca9f7808cdeeb530b61948f66/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73657267696f72732f706970656c696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sergiors/pipeline/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/fa2e492e379634f765e94db6647fb84a7b2de49bc3f71373fc165bd1f96c0747/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73657267696f72732f706970656c696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sergiors/pipeline/?branch=master)[![Build Status](https://camo.githubusercontent.com/6db93c5c085929471626bbbc087f7f811f4e4dfc0814ce5f41c3194dce6eb121/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73657267696f72732f706970656c696e652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sergiors/pipeline/build-status/master)

Install
-------

[](#install)

```
composer require sergiors/pipeline
```

How to use
----------

[](#how-to-use)

```
use Sergiors\Pipeline\Pipeline;

$pipeline = (new Pipeline)
    ->pipe(function ($payload) {
        return $payload + 2;
    })
    ->pipe(function ($payload) {
        return $payload * 2;
    });

echo $pipeline(10); // => 24
// echo $pipeline->process(10);
```

```
$pipeline = (new Pipeline)
    ->pipe(function ($payload, $container) {
        ...
    })
    ->pipe(function ($payload, $container) {
        ...
    });

$container = ...;
$pipeline(10, $container);
```

You can use `Sergiors\Pipeline\Reduce`, `Sergiors\Pipeline\Filter` and `Sergiors\Pipeline\Map` to compose the pipeline more readable.

```
use Sergiors\Pipeline\Pipeline;
use Sergiors\Pipeline\Filter;

$getOrgs = (new Pipeline)
    ->pipe(new Filter(function ($org) {
        return $org instanceof OrgInterface;
    }));

// an array with OrgInterface and UserInterface objects
$users = [...];

print_r($getOrgs($users));
```

Motivation
----------

[](#motivation)

[Collection Pipeline](http://martinfowler.com/articles/collection-pipeline/)

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3403d ago

Major Versions

1.0.0 → 2.0.02017-04-19

PHP version history (2 changes)1.0.0PHP ^5.5|^7.0

2.0.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/75b67763139f7a8c96302299f5a40a386d565829af3061bb55465c8808d54428?d=identicon)[sergiors](/maintainers/sergiors)

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[eusonlito/laravel-meta

A package to manage Header Meta Tags

193551.7k2](/packages/eusonlito-laravel-meta)[roots/bedrock-autoloader

An autoloader that enables standard plugins to be required just like must-use plugins

416.3M65](/packages/roots-bedrock-autoloader)

PHPackages © 2026

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