PHPackages                             haikara/middleware-stack - 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. haikara/middleware-stack

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

haikara/middleware-stack
========================

0.1.0(1y ago)0141PHPPHP &gt;=8.0 &lt;8.4.0

Since Aug 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HaikaraSakura/middleware-stack)[ Packagist](https://packagist.org/packages/haikara/middleware-stack)[ RSS](/packages/haikara-middleware-stack/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

MiddlewareStack
===============

[](#middlewarestack)

PSR-15 RequestHandlerInterfaceの実装。
Middlewareをスタックし、順に実行する。

基本的な使い方
-------

[](#基本的な使い方)

ミドルウェアの登録

```
// $containerはPSR-11:ContainerInterfaceの実装
// 後述のMiddleware1, Middleware2, Middleware3を登録済みのものとする
$handler = RequestHandler::createFromContainer($container);

// 中心になるAction
$action = static function () {
    echo 'Action' . PHP_EOL;
    return new Response();
};

$handler->addMiddleware($action);

// 一括登録
$handler->addMiddlewares([
    Middleware1::class,
    Middleware2::class,
    Middleware3::class,
]);

// 実行
$response = $handler->handle($request);

/*
 * Middleware3, Middleware2, Middleware1, $actionの順で実行される
 */
```

インスタンス化
-------

[](#インスタンス化)

PSR-15:ContainerInterfaceを渡す方法。

```
$handler = RequestHandler::createFromContainer($container);
```

任意の処理を渡す方法。

```
$handler = new RequestHandler(fn (string $entry) => $entry);
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

682d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2d62cb7d653d3982799fb210ad6d95b2d49ed74bfe137a335ff3793bdf164e6?d=identicon)[HaikaraSakura](/maintainers/HaikaraSakura)

---

Top Contributors

[![HaikaraSakura](https://avatars.githubusercontent.com/u/87011031?v=4)](https://github.com/HaikaraSakura "HaikaraSakura (1 commits)")[![t-mori-haikara](https://avatars.githubusercontent.com/u/87011031?v=4)](https://github.com/t-mori-haikara "t-mori-haikara (1 commits)")

### Embed Badge

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

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.5k1.5M86](/packages/mcp-sdk)[bref/bref

Bref is a framework to write and deploy serverless PHP applications on AWS Lambda.

3.4k10.6M67](/packages/bref-bref)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)[xima/xima-typo3-frontend-edit

Frontend Edit - This extension provides an edit button for editors within frontend content elements.

1414.3k](/packages/xima-xima-typo3-frontend-edit)

PHPackages © 2026

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