_status = $status; } /** * Геттер/сеттер тела ответа. * * @param string|null $content Новое тело или null для чтения * @return string|static Тело при чтении, $this при записи */ public function body(?string $content = null): string|static { if ($content === null) { return $this->_body; } $this->_body = $content; return $this; } /** * Геттер/сеттер статус-кода. При установке вызывает http_response_code(). * * @param int|null $code Новый код или null для чтения * @return int|static Код при чтении, $this при записи */ public function status(?int $code = null): int|static { if ($code === null) { return $this->_status; } $this->_status = $code; http_response_code($code); return $this; } }