A middleware dispatcher supporting psr15.
A PSR-15 compliant server middleware dispatcher implementation.
The goal of this package is to implement the (currently in draft) PSR-15 spec for middleware in as simple a way as possible.
The entire package MUST be covered by tests.
See PSR-15 spec for more detailed info on implementing middleware.
<?php use JRalph\ServerMiddleware\Dispatcher; $dispatcher = (new Dispatcher()) ->addMiddleware( /** * Implementations of Psr\Http\Server\MiddlewareInterface */ $firstMiddleware, $secondMiddleware, $thirdMiddleware ); /** @var \Psr\Http\Message\ServerRequestInterface $request */ $request = new Request; $response = $dispatcher->handle($request);