PHPackages                             yaroslawww/php-pipe-passage - 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. yaroslawww/php-pipe-passage

ActiveLibrary

yaroslawww/php-pipe-passage
===========================

Alternative implementation 'Chain of Responsibility' pattern, using pipe.

1.0.0(4y ago)06MITPHPPHP &gt;=8.0

Since Nov 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/yaroslawww/php-pipe-passage)[ Packagist](https://packagist.org/packages/yaroslawww/php-pipe-passage)[ Docs](https://github.com/yaroslawww/php-pipe-passage)[ RSS](/packages/yaroslawww-php-pipe-passage/feed)WikiDiscussions master Synced 2d ago

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

Alternative implementation 'Chain of Responsibility' pattern, using pipe.
=========================================================================

[](#alternative-implementation-chain-of-responsibility-pattern-using-pipe)

[![Packagist License](https://camo.githubusercontent.com/059502872a298503c821fbb02271e7d6e10edafecf45aeefbf374665e101052e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7961726f736c617777772f7068702d706970652d706173736167653f636f6c6f723d253233346463373166)](https://github.com/yaroslawww/php-pipe-passage/blob/master/LICENSE.md)[![Packagist Version](https://camo.githubusercontent.com/e060c3e8fa2233253bade0e7c2e083c3825a6ae3c2364a3040fd938d3018f5d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7961726f736c617777772f7068702d706970652d70617373616765)](https://packagist.org/packages/yaroslawww/php-pipe-passage)[![Total Downloads](https://camo.githubusercontent.com/ce4e90c18bea8f91a916a1fb6c99794a657e048f331937c42a2fa3ab81e804cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7961726f736c617777772f7068702d706970652d70617373616765)](https://packagist.org/packages/yaroslawww/php-pipe-passage)[![Build Status](https://camo.githubusercontent.com/2239a646cf1c59befa7a0a209033cc47ba0a86277e0d5fdeb2d7091a084e0221/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7961726f736c617777772f7068702d706970652d706173736167652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yaroslawww/php-pipe-passage/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/5b8321d09e95a52482efb6537f657b4d95bde1a3d82f9c51734ec18123eb8679/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7961726f736c617777772f7068702d706970652d706173736167652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yaroslawww/php-pipe-passage/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4eed0e32ab151fbf2b96996e6928849f523a928f8cb7c50b431203b7f30b699e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7961726f736c617777772f7068702d706970652d706173736167652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yaroslawww/php-pipe-passage/?branch=master)

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

[](#installation)

Install the package via composer:

```
composer require yaroslawww/php-pipe-passage
```

Usage
-----

[](#usage)

```
 $pipe = Pipe::make([
    function ($entity, \Closure $next) {
        $entity->test = 'test value';

        return $next($entity);
    },
    function ($entity, \Closure $next) {
        $entity->test2 = 'second test value';

        return $next($entity);
    },
])
            ->next(SetNameHandler::class)
            ->next(new SetCompanyHandler('web company'))
            ->next(function ($entity, \Closure $next) {
                $entity->test3 = 'third test value';

                return $next($entity);
            });

$entityObject = $pipe->pass(new \stdClass());

$this->assertEquals('test value', $entityObject->test);
$this->assertEquals('second test value', $entityObject->test2);
$this->assertEquals('third test value', $entityObject->test3);
$this->assertEquals('default', $entityObject->name);
$this->assertEquals('web company', $entityObject->company);

```

Example of handler

```
class ExamplePipeSection implements PipeSection {

    public function handle($entity, \Closure $next)
    {
        // There will be some functionality

        return $next($entity);
    }

}

```

Credits
-------

[](#credits)

- [![Think Studio](https://camo.githubusercontent.com/8e541bece07d503c85a126b5294865faa00e27371048772f566a0cce8c01fd3a/68747470733a2f2f7961726f736c617777772e6769746875622e696f2f696d616765732f73706f6e736f72732f7061636b616765732f6c6f676f2d7468696e6b2d73747564696f2e706e67)](https://think.studio/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

1646d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23663794?v=4)[yaroslawww](/maintainers/yaroslawww)[@yaroslawww](https://github.com/yaroslawww)

---

Top Contributors

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

---

Tags

phppattern

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/yaroslawww-php-pipe-passage/health.svg)

```
[![Health](https://phpackages.com/badges/yaroslawww-php-pipe-passage/health.svg)](https://phpackages.com/packages/yaroslawww-php-pipe-passage)
```

###  Alternatives

[awes-io/repository

Implementation of repository pattern for Laravel. The package allows out-of-the-box filtering of data based on parameters in the &lt;b&gt;request&lt;/b&gt;, and also allows you to quickly integrate the list filters and custom criteria.

172105.4k5](/packages/awes-io-repository)[timwassenburg/laravel-service-generator

Generate Laravel services

104233.1k2](/packages/timwassenburg-laravel-service-generator)[rolfvreijdenberger/izzum-statemachine

A superior statemachine library php &gt;= 5.3. Integrates with your domain models perfectly.

7425.5k](/packages/rolfvreijdenberger-izzum-statemachine)[larachimp/mango-repo

Simple repository package for Laravel 5.

317.2k](/packages/larachimp-mango-repo)[timwassenburg/laravel-artisan-extender

A collection of generators for Laravel

111.4k](/packages/timwassenburg-laravel-artisan-extender)

PHPackages © 2026

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