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 today

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 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

2408d 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

[cakephp/cakephp

The CakePHP framework

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

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

3.4k10.6M67](/packages/bref-bref)[sunrise/http-router

A powerful solution as the foundation of your project.

17451.6k10](/packages/sunrise-http-router)[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)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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