bauhaus / middleware-chain
PSR-15 middleware chain
v0.0.0
2017-05-31 02:59 UTC
Requires
- http-interop/http-middleware: ^0.4.1
- psr/container: ^1.0
Requires (Dev)
- phpunit/phpunit: ^6.1
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-10-23 17:34:44 UTC
README
Bauhaus Middleware Chain
This package helps you to build a PSR-15 Middleware chain to process PSR-7 Server Requests and get PSR-7 Response.
<?php use Bauhaus\MiddlewareChain; use SomeVendor\Middleware1; use AnotherVendor\Middleware2; $diContainer = require_once 'diContinaer.php'; // Psr\Container\ContainerInterface $request = require_once 'request.php'; $chain = new Chain($diContainer); $chain->stackUp(new Middleware1()); $chain->stackUp(Middleware2::class); // This will be loaded with $diContainer->get(Middleware2::class) $response = $chain->handle($request);