Created
June 10, 2016 14:56
-
-
Save Crell/d0d75a6112b14c18b44078351ec1fd33 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
function the_real_all(ServerRequestInterface $req, callable $next) { | |
$action = $req->getAttribute('_action'); | |
$args = $req->getAttribute('_arguments); | |
$result = $action(...$args); | |
if (! $result instanceof ResponseInterface) { | |
$responder = resolve_responder(get_class($result)); | |
$result = $responder($result); | |
} | |
return $next($req, $result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment