rosstuck / prosaic
Yet another boring PSR-15 middleware dispatcher
v0.1
2020-08-01 14:30 UTC
Requires
- php: >=7.4
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- doctrine/coding-standard: ^8.1
- laminas/laminas-diactoros: ^2.3
- phpstan/phpstan: ^0.12.33
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2024-10-09 05:43:35 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