ResponseInterface.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\HTTP;
  4. /**
  5. * This interface represents a HTTP response.
  6. *
  7. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  8. * @author Evert Pot (http://evertpot.com/)
  9. * @license http://sabre.io/license/ Modified BSD License
  10. */
  11. interface ResponseInterface extends MessageInterface
  12. {
  13. /**
  14. * Returns the current HTTP status code.
  15. */
  16. public function getStatus(): int;
  17. /**
  18. * Returns the human-readable status string.
  19. *
  20. * In the case of a 200, this may for example be 'OK'.
  21. */
  22. public function getStatusText(): string;
  23. /**
  24. * Sets the HTTP status code.
  25. *
  26. * This can be either the full HTTP status code with human-readable string,
  27. * for example: "403 I can't let you do that, Dave".
  28. *
  29. * Or just the code, in which case the appropriate default message will be
  30. * added.
  31. *
  32. * @param string|int $status
  33. *
  34. * @throws \InvalidArgumentException
  35. */
  36. public function setStatus($status);
  37. }