diff --git a/src/pjdietz/WellRESTed/Response.php b/src/pjdietz/WellRESTed/Response.php index dd8a9fd..b1ed5e5 100644 --- a/src/pjdietz/WellRESTed/Response.php +++ b/src/pjdietz/WellRESTed/Response.php @@ -53,7 +53,7 @@ class Response extends Message implements ResponseInterface { parent::__construct(); - $this->statusCode = $statusCode; + $this->setStatusCode($statusCode); if (is_array($headers)) { $this->headers = $headers; @@ -124,6 +124,18 @@ class Response extends Message implements ResponseInterface return $this->statusCode; } + /** @return string HTTP status line, e.g. HTTP/1.1 200 OK. */ + public function getStatusLine() + { + return sprintf( + '%s/%s %s %s', + strtoupper($this->protocol), + $this->protocolVersion, + $this->statusCode, + $this->reasonPhrase + ); + } + /** * Set the status code and optionally the reason phrase explaining it. * @@ -295,18 +307,6 @@ class Response extends Message implements ResponseInterface // ------------------------------------------------------------------------- - /** @return string HTTP status line, e.g. HTTP/1.1 200 OK. */ - protected function getStatusLine() - { - return sprintf( - '%s/%s %s %s', - strtoupper($this->protocol), - $this->protocolVersion, - $this->statusCode, - $this->reasonPhrase - ); - } - /** Output the contents of a file */ private function outputBodyFile() {