From cc8b48bc5707d24c7b7609efcd4b7575cf5951b5 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 9 Mar 2017 09:50:03 -0600 Subject: [PATCH] Provide a final handler to the server Per @xtreamwayz --- doc/book/middleware.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/book/middleware.md b/doc/book/middleware.md index 91c3374..0713293 100644 --- a/doc/book/middleware.md +++ b/doc/book/middleware.md @@ -7,9 +7,10 @@ take the incoming request, perform actions based on it, and either complete the response or pass delegation on to the next middleware in the queue. ```php -use Zend\Stratigility\MiddlewarePipe; use Zend\Diactoros\Response; use Zend\Diactoros\Server; +use Zend\Stratigility\MiddlewarePipe; +use Zend\Stratigility\NoopFinalHandler; require __DIR__ . '/../vendor/autoload.php'; @@ -33,7 +34,7 @@ $app->pipe('/foo', function ($req, $res, $next) { return $res; }); -$server->listen(); +$server->listen(new NoopFinalHandler()); ``` In the above example, we have two examples of middleware. The first is a