PHPackages                             kovagoz/http-middleware-request-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. kovagoz/http-middleware-request-dispatcher

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

kovagoz/http-middleware-request-dispatcher
==========================================

PSR-15 compatible request dispatcher

1.0.0(4y ago)05MITPHPPHP ^7.4|^8.0

Since Aug 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kovagoz/http-middleware-request-dispatcher)[ Packagist](https://packagist.org/packages/kovagoz/http-middleware-request-dispatcher)[ RSS](/packages/kovagoz-http-middleware-request-dispatcher/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

PSR-15 compatible request dispatcher
====================================

[](#psr-15-compatible-request-dispatcher)

The purpose of this middleware is to dispatch the request to the assigned handler, also known as the controller.

[![phpunit workflow](https://github.com/kovagoz/http-middleware-request-dispatcher/actions/workflows/php.yml/badge.svg)](https://github.com/kovagoz/http-middleware-request-dispatcher/actions/workflows/php.yml/badge.svg)

Requirements
------------

[](#requirements)

- PHP 7.4 or above

Usage
-----

[](#usage)

Middleware needs a *resolver* object to be able to make the proper request handler object. It must be injected through the constructor. This package contains a simple resolver implementation which uses a PSR-11 compatible DI container to do the job:

```
$resolver   = new ContainerResolver($container);
$middleware = new RequestDispatcher($resolver);
```

Middleware looks for a special attribute of the request object called *\_\_handler*. This attribute tells which handler should handle the request. If it's missing, nothing happens, request will be passed to the next middleware.

Here an example how you can tell which handler should handle the request:

```
// PSR-7 server request object
$request = $request->withAttribute('__handler', MyController::class);
$middleware->process($request, $nextMiddleware);
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1797d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/664c17e6a7f99c063d1734e49da5623df8d9e91a30a692fcbb10bfc375eff43b?d=identicon)[kovagoz](/maintainers/kovagoz)

---

Top Contributors

[![kovagoz](https://avatars.githubusercontent.com/u/807434?v=4)](https://github.com/kovagoz "kovagoz (1 commits)")

---

Tags

middlewarephppsr-15

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kovagoz-http-middleware-request-dispatcher/health.svg)

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

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[cakephp/cakephp

The CakePHP framework

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

PSR-15 Middleware Microframework

3923.8M126](/packages/mezzio-mezzio)[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)[hyperf/hyperf

A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.

6.9k3.3k2](/packages/hyperf-hyperf)[api-platform/state

API Platform state interfaces

274.9M136](/packages/api-platform-state)

PHPackages © 2026

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