Skip to content

Instantly share code, notes, and snippets.

@shadowhand
Created November 14, 2016 02:22
Show Gist options
  • Save shadowhand/c4cd6bcb2ff65b53d9ae41b047fee1f1 to your computer and use it in GitHub Desktop.
Save shadowhand/c4cd6bcb2ff65b53d9ae41b047fee1f1 to your computer and use it in GitHub Desktop.
// current proposal
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
{
// ...
return $delegate->process($request);
}
// alternative
public function process(ServerRequestInterface $request, DelegateInterface $next)
{
// ...
return $next($request);
}
// assuming that...
interface DelegateInterface
{
public function __invoke(ServerRequestInterface $request);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment