PHPackages                             idiosyncratic/http-router - 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. idiosyncratic/http-router

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

idiosyncratic/http-router
=========================

A lightweight PSR-15 based HTTP router implementation

0.5.1(6y ago)06ISCPHPPHP &gt;=7.3

Since Nov 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/idiosyncratic-code/http-router)[ Packagist](https://packagist.org/packages/idiosyncratic/http-router)[ RSS](/packages/idiosyncratic-http-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

The Idiosyncratic Router
========================

[](#the-idiosyncratic-router)

A lightweight PSR-15 HTTP router implementation.

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

[](#installation)

Use [Composer](https://getcomposer.org):

```
composer require idiosyncratic/http-router

```

Usage
-----

[](#usage)

`Idiosyncratic\Http\Router\Router` implementing the PSR-15 `Psr\Http\Server\RequestHandlerInterface` is the main class. It has two dependencies:

- An implementation of `Idiosyncratic\Http\Router\RouteCollection`, a collection of routes implementing a single method: ```
    /**
     * @throws Idiosyncratic\Http\Exception\Client\NotFound
     * @throws Idiosyncratic\Http\Exception\Client\MethodNotAllowed
     */
    public function findRoute(ServerRequestInterface $request) : Idiosyncratic\Http\Router\Route;
    ```
- `Psr\Container\ContainerInterface`, responsible for retrieving the handler for the matched route.

Also included is `Idiosyncratic\Http\Router\RouteGroup`, a basic implementation of the `RouteCollection` interface based on [FastRoute](https://github.com/nikic/FastRoute). The interface for defining routes is nearly identical to [FastRoute's](https://github.com/nikic/FastRoute#defining-routes), with two notable exceptions:

- The argument order for `RouteGroup::addRoute` is different. Route methods are defined last as string parameters.
- The route handler must be the name of a class implementing `Psr\Http\Server\RequestHandlerInterface`.

Basic usage of the library (using the [PHP League Container](https://container.thephpleague.com)):

```
$container = new League\Container\Container();

$container->add(ServerRequestInterfaceImplementation::class);

$routes = new Idiosyncratic\Http\Router\RouteGroup();

$routes->addRoute('/hello', ServerRequestInterfaceImplementation::class, 'GET', 'POST');

$router = new Idiosyncratic\Http\Router\Router($routes, $container);

// Create instance of Psr\Http\Message\ServerRequestInterface...

$response = $router->handle($serverRequest);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Every ~0 days

Total

2

Last Release

2353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0995074b7e20d6f5efab38a8e956a12dbaf93f8ef3592d11c5d884d631f8658a?d=identicon)[jcsilkey](/maintainers/jcsilkey)

---

Top Contributors

[![jcsilkey](https://avatars.githubusercontent.com/u/1775194?v=4)](https://github.com/jcsilkey "jcsilkey (20 commits)")

---

Tags

psr-7psr-15

### Embed Badge

![Health badge](/badges/idiosyncratic-http-router/health.svg)

```
[![Health](https://phpackages.com/badges/idiosyncratic-http-router/health.svg)](https://phpackages.com/packages/idiosyncratic-http-router)
```

###  Alternatives

[league/route

Fast routing and dispatch component including PSR-15 middleware, built on top of FastRoute.

6633.1M116](/packages/league-route)[psr/http-server-middleware

Common interface for HTTP server-side middleware

18091.2M1.5k](/packages/psr-http-server-middleware)[mezzio/mezzio-swoole

Swoole support for Mezzio

92238.9k3](/packages/mezzio-mezzio-swoole)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[sunrise/http-router

A powerful solution as the foundation of your project.

16249.8k10](/packages/sunrise-http-router)[mezzio/mezzio-cors

CORS component for Mezzio and other PSR-15 middleware runners.

17568.5k5](/packages/mezzio-mezzio-cors)

PHPackages © 2026

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