Skip to content

Instantly share code, notes, and snippets.

@hannesvdvreken
Created June 1, 2016 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannesvdvreken/6767f0b423a28b24e7c588c22f552b78 to your computer and use it in GitHub Desktop.
Save hannesvdvreken/6767f0b423a28b24e7c588c22f552b78 to your computer and use it in GitHub Desktop.
<?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