Promote Response::getStatusLine() to public
Fix issue where response phrase was not set in Response constructor.
This commit is contained in:
parent
8049635837
commit
566384f1e4
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue