PHPackages                             gilsegura/psr-server - 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. [API Development](/categories/api)
4. /
5. gilsegura/psr-server

ActiveLibrary[API Development](/categories/api)

gilsegura/psr-server
====================

The component provides infrastructure for building PSR-15 request handlers and middleware pipelines, plus a typed response factory for serializable payloads.

1.1.0(2w ago)05262MITPHPPHP ^8.4CI passing

Since Dec 3Pushed 2w ago1 watchersCompare

[ Source](https://github.com/gilsegura/psr-server)[ Packagist](https://packagist.org/packages/gilsegura/psr-server)[ RSS](/packages/gilsegura-psr-server/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (11)Versions (6)Used By (2)

PSR SERVER
==========

[](#psr-server)

[![tests](https://github.com/gilsegura/psr-server/actions/workflows/tests.yaml/badge.svg)](https://github.com/gilsegura/psr-server/actions/workflows/tests.yaml)[![codecov](https://camo.githubusercontent.com/9ba23da55f2801237a0044887510e435d81d97b9e18a09bcd25cf13c905235ac/68747470733a2f2f636f6465636f762e696f2f6769746875622f67696c7365677572612f7073722d7365727665722f67726170682f62616467652e737667)](https://codecov.io/github/gilsegura/psr-server)[![static analysis](https://github.com/gilsegura/psr-server/actions/workflows/static-analysis.yaml/badge.svg)](https://github.com/gilsegura/psr-server/actions/workflows/static-analysis.yaml)[![coding standards](https://github.com/gilsegura/psr-server/actions/workflows/coding-standards.yaml/badge.svg)](https://github.com/gilsegura/psr-server/actions/workflows/coding-standards.yaml)

Minimal, framework-agnostic PSR-15 server primitives: a middleware runner, a request handler and a response factory. It gives you the small pieces needed to run a request through a middleware pipeline and build a response, without pulling in a full framework.

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

[](#installation)

```
composer require gilsegura/psr-server
```

Middleware pipeline
-------------------

[](#middleware-pipeline)

- **`MiddlewareRunner`** — takes a variadic list of PSR-15 middlewares and runs a request through them in order, delegating to a terminal `RequestHandlerInterface`at the end. It is the engine behind a request pipeline.
- **`StackMiddleware`** — adapts the run to the PSR-15 stack model, advancing to the next middleware in the chain.
- **`RequestHandler`** — a `RequestHandlerInterface` that wraps the runner and a terminal handler, so the whole pipeline is itself a single PSR-15 handler.

Responses
---------

[](#responses)

- **`ResponseFactory`** — an invokable that builds a PSR-7 response from a status and body.
- **`Status`** — an `int`-backed enum of HTTP status codes (`OK`, `CREATED`, `NO_CONTENT`, `BAD_REQUEST`, `UNAUTHORIZED`, …), so status codes are referenced by name instead of magic numbers.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance63

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

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

Total

5

Last Release

20d ago

Major Versions

0.1.0 → 1.0.02026-06-11

PHP version history (2 changes)0.1.0PHP &gt;=8.3

1.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29969702?v=4)[josué](/maintainers/gilsegura)[@gilsegura](https://github.com/gilsegura)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gilsegura-psr-server/health.svg)

```
[![Health](https://phpackages.com/badges/gilsegura-psr-server/health.svg)](https://phpackages.com/packages/gilsegura-psr-server)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[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)[thecodingmachine/graphqlite

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

5733.3M47](/packages/thecodingmachine-graphqlite)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)[tempest/framework

The PHP framework that gets out of your way.

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

The next generation PHP framework.

25740.3k1](/packages/windwalker-framework)

PHPackages © 2026

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