rosstuck/prosaic

Yet another boring PSR-15 middleware dispatcher

v0.1 2020-08-01 14:30 UTC

This package is auto-updated.

Last update: 2024-04-09 04:37:51 UTC


README

A boring PSR-15 Middleware dispatcher

Prosaic can run your incoming PSR-7 requests through a pipeline of PSR-15 middleware. There's no fancy builder methods, routing or DI container integration, it's really just a pipeline of middleware. That's it.

Installation

composer require rosstuck/prosaic

Example

You can set up your middleware pipeline like so:

<?php

$dispatcher = new Prosaic\HttpDispatcher(
    new FirstMiddleware(),
    new SecondMiddleware(),
    new ThirdMiddleware()
);

$response = $dispatcher->dispatch($request);

Testing

composer test