Created
June 1, 2016 08:44
-
-
Save hannesvdvreken/6767f0b423a28b24e7c588c22f552b78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Psr\Http\Message\ResponseRequestInterface; | |
use Psr\Http\Message\ServerRequestInterface; | |
function (ServerRequestInterface $request, ResponseInterface $response, callable $next) | |
{ | |
// Do something with the Request or stop execution and return a Response here. | |
... | |
// Call the next middleware | |
$response = $next($request, $response); | |
// Modify the response, if you like, before returning it. | |
... | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment