From a0d047b06f20e9e081a8536fa53c470d2add1157 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Sun, 15 Apr 2012 18:30:07 -0500 Subject: [PATCH] Return from Response::prepare() so that the method may be chained. --- src/Symfony/Component/HttpFoundation/Response.php | 4 ++++ src/Symfony/Component/HttpFoundation/StreamedResponse.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 6582accfb2..0c4e62b4eb 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -198,6 +198,8 @@ class Response * the Request that is "associated" with this Response. * * @param Request $request A Request instance + * + * @return Response The current response. */ public function prepare(Request $request) { @@ -237,6 +239,8 @@ class Response $headers->set('Content-Length', $length); } } + + return $this; } /** diff --git a/src/Symfony/Component/HttpFoundation/StreamedResponse.php b/src/Symfony/Component/HttpFoundation/StreamedResponse.php index 1952a848b7..599170fae8 100644 --- a/src/Symfony/Component/HttpFoundation/StreamedResponse.php +++ b/src/Symfony/Component/HttpFoundation/StreamedResponse.php @@ -82,7 +82,7 @@ class StreamedResponse extends Response $this->headers->set('Cache-Control', 'no-cache'); - parent::prepare($request); + return parent::prepare($request); } /**