PHPackages                             fastd/middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fastd/middleware

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fastd/middleware
================

v1.2.3(8y ago)318.2k33MITPHPPHP &gt;=5.6

Since Jan 9Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/fastdlabs/middleware)[ Packagist](https://packagist.org/packages/fastd/middleware)[ RSS](/packages/fastd-middleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (21)Used By (3)

middleware
==========

[](#middleware)

[![Build Status](https://camo.githubusercontent.com/0f3ebfbc7fbfe2b96f9af5e1177c1ba4bbbaef75d4cc9d1ee95dee84d0155803/68747470733a2f2f7472617669732d63692e6f72672f66617374646c6162732f6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fastdlabs/middleware)[![Support PSR15](https://camo.githubusercontent.com/02279f02b7f4b53d69889709429c17461bd86f4d4bbbbbedcddd21232107b974/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72742d70737231352d627269676874677265656e2e737667)](https://travis-ci.org/fastdlabs/middleware)[![Latest Stable Version](https://camo.githubusercontent.com/3eddc7af97411675e5ef74c383885f6775149a3d76b4706b75b48e7fc55e22cf/68747470733a2f2f706f7365722e707567782e6f72672f66617374642f6d6964646c65776172652f762f737461626c65)](https://packagist.org/packages/fastd/middleware)[![Total Downloads](https://camo.githubusercontent.com/c5f44cda02324a4b0aba17dbd2052df6927b1f9d368b48400b7f6af256a8fd30/68747470733a2f2f706f7365722e707567782e6f72672f66617374642f6d6964646c65776172652f646f776e6c6f616473)](https://packagist.org/packages/fastd/middleware)[![License](https://camo.githubusercontent.com/8e81614304b40e22c743c624ae73f5eacf477f064e399883ff803b5a10554e80/68747470733a2f2f706f7365722e707567782e6f72672f66617374642f6d6964646c65776172652f6c6963656e7365)](https://packagist.org/packages/fastd/middleware)[![composer.lock](https://camo.githubusercontent.com/8cb8d4571fa420cbff84ecce1ffe151900e99b83cd368aae3e006136f3a1f789/68747470733a2f2f706f7365722e707567782e6f72672f66617374642f6d6964646c65776172652f636f6d706f7365726c6f636b)](https://packagist.org/packages/fastd/middleware)

Http 中间件，实现PSR15

### requirement

[](#requirement)

- php &gt;= 5.6

### installation

[](#installation)

```
composer require "fastd/middlware" -vvv

```

```
$middleware = new Middleware(function (RequestInterface $request, DelegateInterface $next) {
    // delegate control to next middleware
    return $next($request);
});

$middleware2 = new Middleware(function (RequestInterface $request, DelegateInterface $next) {
    echo 'world';
});

$dispatcher = new Dispatcher([
    $middleware,
    $middleware2
]);

$response = $dispatcher->dispatch(new ServerRequest('GET', '/'));
```

### 贡献

[](#贡献)

非常欢迎感兴趣，愿意参与其中，共同打造更好PHP生态，Swoole生态的开发者。

如果你乐于此，却又不知如何开始，可以试试下面这些事情：

- 在你的系统中使用，将遇到的问题 [反馈](https://github.com/JanHuang/fastD/issues)。
- 有更好的建议？欢迎联系  或 [新浪微博:编码侠](http://weibo.com/ecbboyjan)。

### 联系

[](#联系)

如果你在使用中遇到问题，请联系: . 微博: [编码侠](http://weibo.com/ecbboyjan)

License MIT
-----------

[](#license-mit)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance52

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~0 days

Total

19

Last Release

3037d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94c2bc821caf23977e1c3deea85e3cbc9a73a632e1afaf778638f7fe9da1c42b?d=identicon)[JanHuang](/maintainers/JanHuang)

---

Top Contributors

[![JanHuang](https://avatars.githubusercontent.com/u/7090871?v=4)](https://github.com/JanHuang "JanHuang (60 commits)")[![RunnerLee](https://avatars.githubusercontent.com/u/7436388?v=4)](https://github.com/RunnerLee "RunnerLee (3 commits)")

---

Tags

middlewarephppsr-15

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fastd-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/fastd-middleware/health.svg)](https://phpackages.com/packages/fastd-middleware)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[kartik-v/yii2-widget-depdrop

Widget that enables setting up dependent dropdowns with nested dependencies (sub repo split from yii2-widgets)

814.9M18](/packages/kartik-v-yii2-widget-depdrop)[fastd/swoole

FastD swoole.

7529.0k3](/packages/fastd-swoole)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
