PHPackages                             procurios/middleware-dispatcher - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. procurios/middleware-dispatcher

ActiveLibrary[HTTP &amp; Networking](/categories/http)

procurios/middleware-dispatcher
===============================

Simple PSR-15 compliant middleware dispatcher.

2.0.0(1y ago)94.7k↓50%2MITPHPPHP &gt;=8.0

Since Feb 1Pushed 1y ago6 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

Middleware Dispatcher
=====================

[](#middleware-dispatcher)

[![Build Status](https://camo.githubusercontent.com/b5a61cf46568dfc0bb88f345b5e9164870e50904d65db4193e38d0edf07c34db/68747470733a2f2f7472617669732d63692e6f72672f70726f637572696f732f6d6964646c65776172652d646973706174636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/procurios/middleware-dispatcher)[![Coverage Status](https://camo.githubusercontent.com/067fc330cd00cef4748b8822aba213d11c9c1a4f569d35ccdccea9cc708379fb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70726f637572696f732f6d6964646c65776172652d646973706174636865722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/procurios/middleware-dispatcher?branch=master)

Simple PSR-15 compliant middleware dispatcher

Goal
----

[](#goal)

The goal of this library is to provide a minimal implementation of the PSR-15 specification that is compatible with older callback middleware.

Installation
------------

[](#installation)

```
composer require procurios/middleware-dispatcher

```

Usage
-----

[](#usage)

See [PSR-15](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md) for detailed information about middleware dispatchers.

```
use Procurios\Http\MiddlewareDispatcher\Dispatcher;

$dispatcher = (new Dispatcher($myFallbackHandler))
    ->withMiddleware($myMiddleware)
    ->withMiddleware($myApp)
;

$response = $dispatcher->handle($request);
```

Or add anonymous callback middleware:

```
use Procurios\Http\MiddlewareDispatcher\Dispatcher;

$dispatcher = (new Dispatcher($myFallbackHandler))
    ->withMiddleware($myMiddleware)
    ->withCallback(function (ServerRequestInterface $request, callable $next) {
        // noop
        return $next($request);
    })
    ->withCallback(function (ServerRequestInterface $request, RequestHandlerInterface $handler) {
        // noop
        return $handler->handle($request);
    })
    ->withMiddleware($myApp)
;

$response = $dispatcher->handle($request);
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance49

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~754 days

Total

5

Last Release

376d ago

Major Versions

0.1 → 1.0.02018-01-27

1.0.1 → 2.0.02025-05-07

PHP version history (3 changes)0.1PHP &gt;=5.6

1.0.0PHP &gt;=7.0

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/665a67aa7d800ab1d6a1c2d32051387d18b637cfdc84149fdf868f8585c8a811?d=identicon)[tacovandenbroek](/maintainers/tacovandenbroek)

---

Top Contributors

[![tacovandenbroek](https://avatars.githubusercontent.com/u/1499481?v=4)](https://github.com/tacovandenbroek "tacovandenbroek (31 commits)")

---

Tags

httppsr-7middlewarepsr-15dispatcher

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M92](/packages/middlewares-utils)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[jimtools/jwt-auth

PSR-15 JWT Authentication middleware, A replacement for tuupola/slim-jwt-auth

20142.3k3](/packages/jimtools-jwt-auth)

PHPackages © 2026

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