From b3a6c6f3464327b867a37d30419b74de0a3d36e8 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 3 May 2010 11:23:53 +0200 Subject: [PATCH] [RequestHandler] removed fluent interface for Response, fixed some PHPDoc --- .../Components/RequestHandler/Response.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Components/RequestHandler/Response.php b/src/Symfony/Components/RequestHandler/Response.php index 7efe7b248d..c338a9acb9 100644 --- a/src/Symfony/Components/RequestHandler/Response.php +++ b/src/Symfony/Components/RequestHandler/Response.php @@ -12,7 +12,7 @@ namespace Symfony\Components\RequestHandler; */ /** - * Response is the base implementation of a server response. + * Response represents an HTTP response. * * @package Symfony * @subpackage Components_RequestHandler @@ -70,6 +70,13 @@ class Response 505 => 'HTTP Version Not Supported', ); + /** + * Constructor. + * + * @param string $content The response content + * @param integer $status The response status code + * @param array $headers An array of response headers + */ public function __construct($content = '', $status = 200, $headers = array()) { $this->setContent($content); @@ -83,6 +90,11 @@ class Response $this->cookies = array(); } + /** + * Returns the response content after sending the headers. + * + * @return string The response content + */ public function __toString() { $this->sendHeaders(); @@ -98,8 +110,6 @@ class Response public function setContent($content) { $this->content = $content; - - return $this; } /** @@ -120,8 +130,6 @@ class Response public function setProtocolVersion($version) { $this->version = $version; - - return $this; } /** @@ -174,8 +182,6 @@ class Response 'secure' => (Boolean) $secure, 'httpOnly' => (Boolean) $httpOnly, ); - - return $this; } /** @@ -191,8 +197,8 @@ class Response /** * Sets response status code. * - * @param string $code HTTP status code - * @param string $text HTTP status text + * @param integer $code HTTP status code + * @param string $text HTTP status text * * @throws \InvalidArgumentException When the HTTP status code is not valid */ @@ -205,8 +211,6 @@ class Response } $this->statusText = false === $text ? '' : (null === $text ? self::$statusTexts[$this->statusCode] : $text); - - return $this; } /**