8000 [RequestHandler] removed fluent interface for Response, fixed some PH… · Arief57/symfony@b3a6c6f · GitHub
[go: up one dir, main page]

Skip to content

Commit b3a6c6f

Browse files
committed
[RequestHandler] removed fluent interface for Response, fixed some PHPDoc
1 parent ca26672 commit b3a6c6f

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/Symfony/Components/RequestHandler/Response.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/**
15-
* Response is the base implementation of a server response.
15+
* Response represents an HTTP response.
1616
*
1717
* @package Symfony
1818
* @subpackage Components_RequestHandler
@@ -70,6 +70,13 @@ class Response
7070
505 => 'HTTP Version Not Supported',
7171
);
7272

73+
/**
74+
* Constructor.
75+
*
76+
* @param string $content The response content
77+
* @param integer $status The response status code
78+
* @param array $headers An array of response headers
79+
*/
7380
public function __construct($content = '', $status = 200, $headers = array())
7481
{
7582
$this->setContent($content);
@@ -83,6 +90,11 @@ public function __construct($content = '', $status = 200, $headers = array())
8390
$this->cookies = array();
8491
}
8592

93+
/**
94+
* Returns the response content after sending the headers.
95+
*
96+
* @return string The response content
97+
*/
8698
public function __toString()
8799
{
88100
$this->sendHeaders();
@@ -98,8 +110,6 @@ public function __toString()
98110
public function setContent($content)
99111
{
100112
$this->content = $content;
101-
102-
return $this;
103113
}
104114

105115
/**
@@ -120,8 +130,6 @@ public function getContent()
120130
public function setProtocolVersion($version)
121131
{
122132
$this->version = $version;
123-
124-
return $this;
125133
}
126134

127135
/**
@@ -174,8 +182,6 @@ public function setCookie($name, $value, $expire = null, $path = '/', $domain =
174182
'secure' => (Boolean) $secure,
175183
'httpOnly' => (Boolean) $httpOnly,
176184
);
177-
178-
return $this;
179185
}
180186

181187
/**
@@ -191,8 +197,8 @@ public function getCookies()
191197
/**
192198
* Sets response status code.
193199
*
194-
* @param string $code HTTP status code
195-
* @param string $text HTTP status text
200+
* @param integer $code HTTP status code
201+
* @param string $text HTTP status text
196202
*
197203
* @throws \InvalidArgumentException When the HTTP status code is not valid
198204
*/
@@ -205,8 +211,6 @@ public function setStatusCode($code, $text = null)
205211
}
206212

207213
$this->statusText = false === $text ? '' : (null === $text ? self::$statusTexts[$this->statusCode] : $text);
208-
209-
return $this;
210214
}
211215

212216
/**

0 commit comments

Comments
 (0)
0