huangdijia / pipeline
1.0.0
2021-03-09 10:04 UTC
Requires
- php: >=7.3
- psr/container: ^1.0|^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- phpstan/phpstan: ^0.12
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); });