RawResponse.php 907 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Engine\Http;
  12. use Hyperf\Engine\Contract\Http\RawResponseInterface;
  13. final class RawResponse implements RawResponseInterface
  14. {
  15. /**
  16. * @param string[][] $headers
  17. */
  18. public function __construct(public int $statusCode, public array $headers, public string $body, public string $version)
  19. {
  20. }
  21. public function getStatusCode(): int
  22. {
  23. return $this->statusCode;
  24. }
  25. public function getHeaders(): array
  26. {
  27. return $this->headers;
  28. }
  29. public function getBody(): string
  30. {
  31. return $this->body;
  32. }
  33. public function getVersion(): string
  34. {
  35. return $this->version;
  36. }
  37. }