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

ActiveLibrary

ice-cream/pipeline
==================

ice-cream pipeline is used to pass something through a pipeline and have it processed and passed back out.

1.0.0(8y ago)111MITPHPPHP &gt;=7.2.0

Since Mar 26Pushed 8y agoCompare

[ Source](https://github.com/AdamKyle/ice-cream-pipeline)[ Packagist](https://packagist.org/packages/ice-cream/pipeline)[ Docs](http://adambalan.com/)[ RSS](/packages/ice-cream-pipeline/feed)WikiDiscussions master Synced 2mo ago

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

Ice Cream Pipeline
==================

[](#ice-cream-pipeline)

[![Build Status](https://camo.githubusercontent.com/04d5aa4019eebd3b99ea8bd336dd514d1bdb37791b8c59a220ce42dd6f629c01/68747470733a2f2f7472617669732d63692e6f72672f4164616d4b796c652f6963652d637265616d2d706970656c696e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AdamKyle/ice-cream-pipeline)[![Packagist](https://camo.githubusercontent.com/713b721442feaac72de4fc8ab48ed7b23624d1b35a46c22a93405eee469b0ebb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963652d637265616d2f706970656c696e652e737667)](https://packagist.org/packages/ice-cream/pipeline)![Maintenance](https://camo.githubusercontent.com/bc62a4386260fb7a4c9f5e3977f2f2bf876ad0374f462e723cedd156953a0da4/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323031382e737667)![Made With Love](https://camo.githubusercontent.com/8e692b7ce6dc41cb29efb7aa471b6e72a0a009ff99bf93ca83023a3da4e177b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d616465253230576974682d4c6f76652d677265656e2e737667)

This is a basic implementation of the pipeline pattern, wherein something is passed through a series of classes and the end result is passed out.

- Requires PHP 7.2
- Is standalone

Purpose
-------

[](#purpose)

I wanted to build this for the Ice cream framework, it would be useful in passing object in through a pipeline and manipulating them.

I also built this to learn the pipeline pattern and how it is used and how other frameworks use the pattern when manipulating objects.

Install
-------

[](#install)

`composer require ice-cream/pipeline`

Documentation
-------------

[](#documentation)

You can see the full documentation for the project [here](https://github.com/AdamKyle/ice-cream-pipeline/blob/master/docs/ApiIndex.md)

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

[](#how-to-use)

```
class AddOne {

    public function customHandle(int $number) {
        return $number + 1;
    }

    public function handle(int $number) {
        return $number + 1;
    }
}

class TimesTwo {

    public function customHandle(int $number) {
        return $number * 2;
    }

    public function handle(int $number) {
        return $number * 2;
    }
}

$response = (new Pipeline())
    ->pass(10)
    ->through([
        new AddOne,
        new TimesTwo,
    ])
    ->withMethod('customHandle')
    ->process()
    ->getResponse();

var_dump($response); // => 22
```

What you will notice here is that we have a set of classes, the value 10 is passed through both of these and then returned in the `getResponse()`, the reason we do not do this, returning the response in `process`, is because you might want to call a new method: `then()` which takes a closure, as you will see in the examples below.

### `then(\Closure $func)`

[](#thenclosure-func)

Building on the above example, lets assume you want to do something after you process the value, or object passed in:

```
(new Pipeline())
    ->pass(10)
    ->through([
        new AddOne,
        new TimesTwo,
    ])
    ->withMethod('customHandle')
    ->process()
    ->then(function($response) {
        $response *= 10;

        var_dump($response); // => 220
    });
```

You cannot call `getResponse` because this is a closure, and anonymous function.

### What if I don't have a custom method?

[](#what-if-i-dont-have-a-custom-method)

```
(new Pipeline())
    ->pass(10)
    ->through([
        new AddOne,
        new TimesTwo,
    ])
    ->process()
    ->then(function($response) {
        $response *= 10;

        var_dump($response); // => 220
    });
```

Building on the above, we see that the classes, `AddOne` and `TimesTwo` implement a `handle()` method. If you do not define a `withMethod(String $string)` then we default to the `handle` method that must be implemented or you get an `\Exception`thrown telling you which class failed to implement the method in question.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

2969d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b355c694c28f31b51b43be0f1c4ba58d09729c77395a10fa4f68989065db6f27?d=identicon)[AdamKyle](/maintainers/AdamKyle)

---

Top Contributors

[![AdamKyle](https://avatars.githubusercontent.com/u/188563?v=4)](https://github.com/AdamKyle "AdamKyle (3 commits)")

---

Tags

librarypipeline

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[league/iso3166

ISO 3166-1 PHP Library

69536.3M116](/packages/league-iso3166)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)[ecentria/ecentria-rest-bundle

Goal of this bundle is to simplify process of creating APIs with Symfony. We use already well-coded libraries, combine them together to simplify process and not to re-invent the wheel. We've chose REST and HATEOS to have unified standards of API requests and responses.

142.4k](/packages/ecentria-ecentria-rest-bundle)

PHPackages © 2026

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