Skip to content

Latest commit

 

History

History
82 lines (57 loc) · 1.96 KB

README.md

File metadata and controls

82 lines (57 loc) · 1.96 KB

pipeline

简体中文 | 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.