fitdev-pro/middleware
Composer 安装命令:
composer require fitdev-pro/middleware
包简介
Simply middleware Implementation.
README 文档
README
Simply Middleware Implementation.
Installation
composer require fitdev-pro/middleware
Usage
Base usage
<?php $hundler = new MiddlewareHundler(new Resolver(), new Queue()); $hundler->append(Foo/Bar/SomeClass::class); $hundler->append(function ($input, $output, $next){ $data += 1; return $next($data); }); $hundler->append(function ($input, $output, $next){ $data += 2; if($data > 4){ return $data; } return $next($data); }); $hundler->append(function ($input, $output, $next){ $data += 3; return $next($data); }); $newData = $hundler->hundle(2);
Contribute
Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 77
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-19