Commit 95bfd825 by Carsten Brandt

removed unnecessary defaul value from Response

parent 1d2185f9
...@@ -93,7 +93,7 @@ class Response extends \yii\base\Response ...@@ -93,7 +93,7 @@ class Response extends \yii\base\Response
415 => 'Unsupported Media Type', 415 => 'Unsupported Media Type',
416 => 'Requested range unsatisfiable', 416 => 'Requested range unsatisfiable',
417 => 'Expectation failed', 417 => 'Expectation failed',
418 => 'Im a teapot', 418 => 'I\'m a teapot',
422 => 'Unprocessable entity', 422 => 'Unprocessable entity',
423 => 'Locked', 423 => 'Locked',
424 => 'Method failure', 424 => 'Method failure',
...@@ -117,6 +117,9 @@ class Response extends \yii\base\Response ...@@ -117,6 +117,9 @@ class Response extends \yii\base\Response
511 => 'Network Authentication Required', 511 => 'Network Authentication Required',
); );
/**
* @var integer the HTTP status code to send with the response.
*/
private $_statusCode; private $_statusCode;
/** /**
* @var HeaderCollection * @var HeaderCollection
...@@ -144,6 +147,9 @@ class Response extends \yii\base\Response ...@@ -144,6 +147,9 @@ class Response extends \yii\base\Response
parent::end(); parent::end();
} }
/**
* @return integer the HTTP status code to send with the response.
*/
public function getStatusCode() public function getStatusCode()
{ {
return $this->_statusCode; return $this->_statusCode;
...@@ -298,7 +304,7 @@ class Response extends \yii\base\Response ...@@ -298,7 +304,7 @@ class Response extends \yii\base\Response
* @param string $attachmentName the file name shown to the user. * @param string $attachmentName the file name shown to the user.
* @param string $mimeType the MIME type of the content. * @param string $mimeType the MIME type of the content.
*/ */
public function sendContentAsFile($content, $attachmentName = 'file', $mimeType = 'application/octet-stream') public function sendContentAsFile($content, $attachmentName, $mimeType = 'application/octet-stream')
{ {
$this->getHeaders() $this->getHeaders()
->addDefault('Pragma', 'public') ->addDefault('Pragma', 'public')
...@@ -321,7 +327,7 @@ class Response extends \yii\base\Response ...@@ -321,7 +327,7 @@ class Response extends \yii\base\Response
* @param string $mimeType the MIME type of the stream content. * @param string $mimeType the MIME type of the stream content.
* @throws HttpException if the requested range cannot be satisfied. * @throws HttpException if the requested range cannot be satisfied.
*/ */
public function sendStreamAsFile($handle, $attachmentName = 'file', $mimeType = 'application/octet-stream') public function sendStreamAsFile($handle, $attachmentName, $mimeType = 'application/octet-stream')
{ {
$headers = $this->getHeaders(); $headers = $this->getHeaders();
fseek($handle, 0, SEEK_END); fseek($handle, 0, SEEK_END);
...@@ -573,7 +579,7 @@ class Response extends \yii\base\Response ...@@ -573,7 +579,7 @@ class Response extends \yii\base\Response
} }
/** /**
* @return boolean whether this response is successfully * @return boolean whether this response is successful
*/ */
public function isSuccessful() public function isSuccessful()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment