coolephp/pipeline

A simple PHP middleware pipeline. - 一个简单的 PHP 中间件管道。

Fund package maintenance!
Wechat

v1.0.0 2021-06-01 09:34 UTC

This package is auto-updated.

Last update: 2024-10-29 05:47:50 UTC


README

简体中文 | ENGLISH

A simple PHP middleware pipeline. - 一个简单的 PHP 中间件管道。

Tests Check & fix styling codecov Latest Stable Version Total Downloads License

Requirement

  • PHP >= 7.2

Installation

$ composer require coolephp/pipeline --prefer-dist -vvv

Register Service

config\app.php add

<?php

return [
    /*
     * 第三方服务
     */
    'providers' => [
        ...
        \Coole\Pipeline\PipelineServiceProvider::class,
        ...
    ],
];

Usage

app('pipeline')
	->send($object)
    ->through($middleware)
    // ->with('bar')
    // ->via('differentMethod')
    // ->thenReturn()
    ->then(function(){
    	// middleware is finished
    });

Testing

$ composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.