huangdijia/pipeline

1.0.0 2021-03-09 10:04 UTC

This package is auto-updated.

Last update: 2024-07-12 07:29:13 UTC


README

Installation

composer require huangdijia/pipeline

Usage

class FooPipeline
{
    public function handle($passable, Closure $next)
    {
        return $next($passable);
    }
}

class BarPipeline
{
    public function handle($passable, Closure $next)
    {
        return $next($passable);
    }
}

$pipes = [
    FooPipeline::class,
    BarPipeline::class,
];

$result = (new Pipeline($container))
    ->send($passable)
    ->through($pipes)
    ->then(function($passable) {
        var_dump($passable);
    });