ResponseInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace OAuth2;
  3. /**
  4. * Interface which represents an object response. Meant to handle and display the proper OAuth2 Responses
  5. * for errors and successes
  6. *
  7. * @see \OAuth2\Response
  8. */
  9. interface ResponseInterface
  10. {
  11. /**
  12. * @param array $parameters
  13. */
  14. public function addParameters(array $parameters);
  15. /**
  16. * @param array $httpHeaders
  17. */
  18. public function addHttpHeaders(array $httpHeaders);
  19. /**
  20. * @param int $statusCode
  21. */
  22. public function setStatusCode($statusCode);
  23. /**
  24. * @param int $statusCode
  25. * @param string $name
  26. * @param string $description
  27. * @param string $uri
  28. * @return mixed
  29. */
  30. public function setError($statusCode, $name, $description = null, $uri = null);
  31. /**
  32. * @param int $statusCode
  33. * @param string $url
  34. * @param string $state
  35. * @param string $error
  36. * @param string $errorDescription
  37. * @param string $errorUri
  38. * @return mixed
  39. */
  40. public function setRedirect($statusCode, $url, $state = null, $error = null, $errorDescription = null, $errorUri = null);
  41. /**
  42. * @param string $name
  43. * @return mixed
  44. */
  45. public function getParameter($name);
  46. }