diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-05-26 11:06:30 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-05-26 11:06:30 +0300 |
| commit | fa1bccd968647f6ab5cce0ec4293b39c6fde7633 (patch) | |
| tree | a51b489a43bdfcc2688bd0855cf3e32382ad958c /classes/Response.php | |
| parent | ab7702f0e3dd63bdeaea3cb6db138878774c3b47 (diff) | |
| download | the-epube-fa1bccd968647f6ab5cce0ec4293b39c6fde7633.tar.gz the-epube-fa1bccd968647f6ab5cce0ec4293b39c6fde7633.tar.xz | |
spaces to tabs
Diffstat (limited to 'classes/Response.php')
| -rw-r--r-- | classes/Response.php | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/classes/Response.php b/classes/Response.php index dcbbc5b..a0620ae 100644 --- a/classes/Response.php +++ b/classes/Response.php @@ -2,45 +2,45 @@ class Response { - private int $status = 200; - /** @var array<string, string> */ - private array $headers = []; - private string $body = ''; + private int $status = 200; + /** @var array<string, string> */ + private array $headers = []; + private string $body = ''; - public function withStatus(int $code, string $reasonPhrase = ''): self - { - $clone = clone $this; - $clone->status = $code; - return $clone; - } + public function withStatus(int $code, string $reasonPhrase = ''): self + { + $clone = clone $this; + $clone->status = $code; + return $clone; + } - public function withHeader(string $name, string $value): self - { - $clone = clone $this; - $clone->headers[$name] = $value; - return $clone; - } + public function withHeader(string $name, string $value): self + { + $clone = clone $this; + $clone->headers[$name] = $value; + return $clone; + } - public function getBody(): string - { - return $this->body; - } + public function getBody(): string + { + return $this->body; + } - public function withBody(string $body): self - { - $clone = clone $this; - $clone->body = $body; - return $clone; - } + public function withBody(string $body): self + { + $clone = clone $this; + $clone->body = $body; + return $clone; + } - public function send(): void - { - if ($this->headers) { - foreach ($this->headers as $name => $value) { - header("$name: $value"); - } - } - http_response_code($this->status); - echo $this->body; - } + public function send(): void + { + if ($this->headers) { + foreach ($this->headers as $name => $value) { + header("$name: $value"); + } + } + http_response_code($this->status); + echo $this->body; + } } |
