PHPackages                             arashrasoulzadeh/piped - 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. arashrasoulzadeh/piped

ActiveLibrary

arashrasoulzadeh/piped
======================

pipe implementation for php

03PHP

Since Aug 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/arashrasoulzadeh/piped)[ Packagist](https://packagist.org/packages/arashrasoulzadeh/piped)[ RSS](/packages/arashrasoulzadeh-piped/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![arashrasoulzadeh](https://camo.githubusercontent.com/3de21917729122e60896ea97e144fa2a92419ce1d69cc26387a073a208448468/68747470733a2f2f636972636c6563692e636f6d2f67682f61726173687261736f756c7a616465682f70697065642e7376673f7374796c653d737667)](https://circleci.com/gh/arashrasoulzadeh/piped)

Simple implementation of pipeline in php, you can use this library to pipe a series of functions and/or classes to be executed sequentialy, piped also supports breaking out of pipeline and reverting.

#### installation

[](#installation)

use the following command to add Piped to your projects:

`composer require arashrasoulzadeh/piped`

#### Definition

[](#definition)

- Pipe : an execution sequence class (extend the `arashrasoulzadeh\piped\Abstracts\Pipe` and override `command` method)

#### Extend

[](#extend)

You should create new Pipe Class that extends `arashrasoulzadeh\piped\Abstracts\Pipe` and override `command` method. there are some parametters you can override :

- `rollback` enable revert the pipe if an error occured.
- `throw_error` enable this to throw error insted of executing the rest of the pipe
- `custom_args` arguments that passed as the second input of pipe array, refer to usage for more info

#### Usage

[](#usage)

After declaring new pipes ( or you may use the Piped pipes) , you can use the following code snipper to call a Pipeline:

```
use arashrasoulzadeh\piped\Piped;
use arashrasoulzadeh\piped\Pipes\SumAllPipe;

$pipe =  Piped::build()->pipe(1,2,3,4)->through(
	SumAllPipe::class,
);

echo $pipe->output(); // 10
```

you may also pass custom arguments to pipe ( can be accessed by `custom_args` array in the pipe) like :

```
use arashrasoulzadeh\piped\Piped;
use arashrasoulzadeh\piped\Pipes\ConcatAllPipe;

$pipe =  Piped::build()->pipe(1,2,3,4)->through(
	[ ConcatAllPipe::class,'-' ],
);

echo $pipe->output(); // 1-2-3-4
```

you can provide unlimited numbers of pipes in `through` method, like :

```
use arashrasoulzadeh\piped\Piped;
use arashrasoulzadeh\piped\Pipes\ConcatAllPipe;

$pipe =  Piped::build()->pipe(1,2,3,4)->through(
	[ NotNullPipe::class , '*' ],
	[ ConcatAllPipe::class,'-' ]
);

echo $pipe->output(); // 1-2-3-4
```

you may also pipe an annoymouse function :

```
use arashrasoulzadeh\piped\Piped;
use arashrasoulzadeh\piped\Pipes\MapPipe;

$pipe =  Piped::build()->pipe(1,2,3,4)->through(
	 [MapPipe::class,function ($item,$index) { return $item+1; }] ,
);

echo $pipe->output(); // 2,3,4,5
```

#### Available pipes

[](#available-pipes)

There are some pre-build Pipes in the library:

- ConcatAllPipe : concatenate all inputs together using provided custom argument ( space as deafult )
- SumAllPipe : sum all input numbers ( you may send false as first custom argument if you dont wanna break the pipe if one of array items is not a numeric )
- NotNullPipe : check if all/some/first input item is null,if so break the pipeline. you may prvide `*` for all items, or an array of indexes for checking ( default is first index )
- MapPipe : map an anonymous function to last output ( per item if array )

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/21bff40bdbe2aa1b858527addbcbeb070cc5964abb1762bfd09be3267c129f31?d=identicon)[arashrasoulzadeh](/maintainers/arashrasoulzadeh)

---

Top Contributors

[![arashrasoulzadeh](https://avatars.githubusercontent.com/u/1297307?v=4)](https://github.com/arashrasoulzadeh "arashrasoulzadeh (36 commits)")

### Embed Badge

![Health badge](/badges/arashrasoulzadeh-piped/health.svg)

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

PHPackages © 2026

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