PHPackages                             codin/relay - 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. codin/relay

ActiveLibrary

codin/relay
===========

Tiny PSR-15 Http Server Middleware Processor

0.1.1(4y ago)16.0kMITPHPPHP &gt;=7.3

Since Aug 19Pushed 4y agoCompare

[ Source](https://github.com/codin/relay)[ Packagist](https://packagist.org/packages/codin/relay)[ RSS](/packages/codin-relay/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Tiny PSR-15 Http Server Middleware Processor
============================================

[](#tiny-psr-15-http-server-middleware-processor)

[![version](https://camo.githubusercontent.com/b3b2817c1141b5f6c83ba2c72826d6aee4e51f962dd8ba5ddc4c0ce6ce5340bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f636f64696e2f72656c6179)](https://camo.githubusercontent.com/b3b2817c1141b5f6c83ba2c72826d6aee4e51f962dd8ba5ddc4c0ce6ce5340bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f636f64696e2f72656c6179)[![workflow](https://camo.githubusercontent.com/591200e82dfe4f892abc63452246e81a5894d09c110565d63e5c9e9f3cb2b7e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636f64696e2f72656c61792f436f6d706f736572)](https://camo.githubusercontent.com/591200e82dfe4f892abc63452246e81a5894d09c110565d63e5c9e9f3cb2b7e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636f64696e2f72656c61792f436f6d706f736572)[![license](https://camo.githubusercontent.com/1fd158c48174a9e453457122150e66be13546dff5dd39c2f5c3fdfb8424ed847/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f64696e2f72656c6179)](https://camo.githubusercontent.com/1fd158c48174a9e453457122150e66be13546dff5dd39c2f5c3fdfb8424ed847/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f64696e2f72656c6179)

Example

```
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

// Define some Middlewares
$response = new class() implements MiddlewareInterface {
    public function process(RequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        $psr17Factory = new Nyholm\Psr7\Factory\Psr17Factory();
        $responseBody = $psr17Factory->createStream('');
        return $psr17Factory->createResponse(200)->withBody($responseBody);
    }
};

$cors = new class() implements MiddlewareInterface {
    public function process(RequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        return $handler->handle($request)->withHeader('Access-Control-Allow-Origin', '*');
    }
};

$exceptions = new class() implements MiddlewareInterface {
    public function process(RequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        try {
            return $handler->handle($request);
        } catch (Throwable $exception) {
            $this->logger->error('Server Error', compact('exception'));
            $psr17Factory = new Nyholm\Psr7\Factory\Psr17Factory();
            $responseBody = $psr17Factory->createStream('Server Error');
            return $psr17Factory->createResponse(500)->withBody($responseBody);
        }
    }
};

// Create a request
$psr17Factory = new Nyholm\Psr7\Factory\Psr17Factory();
$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se');

// Run middlewares on a request to create a response
$relay = new Codin\Relay\Relay([$cors, $exceptions, $response]);
$response = $relay->handle($request);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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 ~579 days

Total

2

Last Release

1517d ago

### Community

Maintainers

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

---

Top Contributors

[![kierwils](https://avatars.githubusercontent.com/u/596586?v=4)](https://github.com/kierwils "kierwils (8 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/codin-relay/health.svg)

```
[![Health](https://phpackages.com/badges/codin-relay/health.svg)](https://phpackages.com/packages/codin-relay)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[windwalker/framework

The next generation PHP framework.

25639.1k1](/packages/windwalker-framework)[selective/samesite-cookie

Secure your site with SameSite cookies

10144.0k](/packages/selective-samesite-cookie)

PHPackages © 2026

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