ResponseFactory.php 920 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Http\Message;
  3. use Psr\Http\Message\ResponseInterface;
  4. use Psr\Http\Message\StreamInterface;
  5. /**
  6. * Factory for PSR-7 Response.
  7. *
  8. * This factory contract can be reused in Message and Server Message factories.
  9. *
  10. * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
  11. */
  12. interface ResponseFactory
  13. {
  14. /**
  15. * Creates a new PSR-7 response.
  16. *
  17. * @param int $statusCode
  18. * @param string|null $reasonPhrase
  19. * @param array $headers
  20. * @param resource|string|StreamInterface|null $body
  21. * @param string $protocolVersion
  22. *
  23. * @return ResponseInterface
  24. */
  25. public function createResponse(
  26. $statusCode = 200,
  27. $reasonPhrase = null,
  28. array $headers = [],
  29. $body = null,
  30. $protocolVersion = '1.1'
  31. );
  32. }