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

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

yuloh/pipeline
==============

A simple functional pipeline

v0.2.0(10y ago)812MITPHPPHP &gt;=7.0

Since Apr 11Pushed 10y agoCompare

[ Source](https://github.com/matt-allan/pipeline)[ Packagist](https://packagist.org/packages/yuloh/pipeline)[ Docs](https://github.com/yuloh/pipeline)[ RSS](/packages/yuloh-pipeline/feed)WikiDiscussions master Synced 4w ago

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

Pipeline
========

[](#pipeline)

[![Latest Version on Packagist](https://camo.githubusercontent.com/26c0d86acb19b99e12b9b6313983d961b81dfbd9f14b0c632ff73cc9518e0913/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79756c6f682f706970656c696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yuloh/pipeline)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/3278938743ea500a4605335c75333ffe094393014635a2828f5fde483e09eb62/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f79756c6f682f706970656c696e652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/yuloh/pipeline)

Introduction
------------

[](#introduction)

yuloh/pipeline is a simple functional pipeline. You can easily chain functions together to process a payload. It's a lot easier to read, and there are less temporary variables than doing it the old fashioned way.

### Goals

[](#goals)

This package aims to expose the simplest API possible.

The programming language elixir has a pipe operator (`|>`) which lets you easily chain functions:

```
1 |> inc |> double
```

I really liked that syntax, and I wanted to write a pipeline package where I didn't have to write `pipe` or `add` over and over, hence this package.

### Why PHP 7 Only?

[](#why-php-7-only)

PHP 7 introduced the [Uniform Variable Syntax](https://wiki.php.net/rfc/uniform_variable_syntax), which means we can do this:

```
pipe('hello world')('strrev')('strtoupper')();
```

Instead of something like this:

```
pipe('hello world')->pipe('strrev')->pipe('strtoupper')->process();
```

Install
-------

[](#install)

Via Composer

```
$ composer require yuloh/pipeline
```

Usage
-----

[](#usage)

To create a new pipeline, invoke the `Yuloh\Pipeline\pipe` function with your payload.

```
use function Yuloh\Pipeline\Pipe;

$pipe = pipe([1, 2]);
```

Once it's created you can keep chaining stages by invoking the pipeline. The stage must be a valid PHP [callable](http://php.net/manual/en/language.types.callable.php).

```
$pipe('array_sum')('sqrt');
```

If you invoke the pipeline without a stage, the pipeline will be processed and the processed payload is returned.

```
$result = $pipe();
```

All together, it looks like this:

```
pipe([1, 2])('array_sum')('sqrt')();
```

### Passing Arguments

[](#passing-arguments)

When adding a stage, any additional arguments will be passed to the stage after the payload. For instance, if you were processing a JSON payload the pipeline might look like this:

```
use function Yuloh\Pipeline\Pipe;

$pastTimes = pipe('{"name": "Matt", "pastTimes": ["playing Legend of Zelda", "programming"]}')
    ('json_decode', true)
    (function ($data) {
        return $data['pastTimes'];
    })
    ('implode', ', ')
    ();

echo $pastTimes; // playing Legend of Zelda, programming
```

In the previous example, `json_decode` would be invoked as `json_decode($payload, true)` to return an array.

### Alternative Method Call Usage

[](#alternative-method-call-usage)

You can also add stages as method calls instead of function arguments. It's a little more readable for pipelines that are only using standard functions.

```
pipe('hello world')
    ->strrev()
    ->strtoupper()
    ->get();
```

Testing
-------

[](#testing)

```
$ composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3725d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9440455?v=4)[Matt A](/maintainers/matt-allan)[@matt-allan](https://github.com/matt-allan)

---

Tags

functionalpipelineyuloh

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[lstrojny/functional-php

Functional primitives for PHP

2.0k7.5M51](/packages/lstrojny-functional-php)[league/pipeline

A plug and play pipeline implementation.

1.0k16.8M84](/packages/league-pipeline)[nikic/iter

Iteration primitives using generators

1.1k6.2M51](/packages/nikic-iter)[lambdish/phunctional

λ PHP functional library

3632.1M24](/packages/lambdish-phunctional)[stolz/assets

An ultra-simple-to-use assets management library

289527.4k8](/packages/stolz-assets)[qaribou/immutable.php

Immutable, highly-performant collections, well-suited for functional programming and memory-intensive applications.

347147.4k](/packages/qaribou-immutablephp)

PHPackages © 2026

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