MiddlewareInterface.php 820 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Psr\Http\Server;
  3. use Psr\Http\Message\ResponseInterface;
  4. use Psr\Http\Message\ServerRequestInterface;
  5. /**
  6. * Participant in processing a server request and response.
  7. *
  8. * An HTTP middleware component participates in processing an HTTP message:
  9. * by acting on the request, generating the response, or forwarding the
  10. * request to a subsequent middleware and possibly acting on its response.
  11. */
  12. interface MiddlewareInterface
  13. {
  14. /**
  15. * Process an incoming server request.
  16. *
  17. * Processes an incoming server request in order to produce a response.
  18. * If unable to produce the response itself, it may delegate to the provided
  19. * request handler to do so.
  20. */
  21. public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface;
  22. }