Return from Response::prepare() so that the method may be chained.

This commit is contained in:
Larry Garfield 2012-04-15 18:30:07 -05:00
parent e7470ffebb
commit a0d047b06f
2 changed files with 5 additions and 1 deletions

View File

@ -198,6 +198,8 @@ class Response
* the Request that is "associated" with this Response. * the Request that is "associated" with this Response.
* *
* @param Request $request A Request instance * @param Request $request A Request instance
*
* @return Response The current response.
*/ */
public function prepare(Request $request) public function prepare(Request $request)
{ {
@ -237,6 +239,8 @@ class Response
$headers->set('Content-Length', $length); $headers->set('Content-Length', $length);
} }
} }
return $this;
} }
/** /**

View File

@ -82,7 +82,7 @@ class StreamedResponse extends Response
$this->headers->set('Cache-Control', 'no-cache'); $this->headers->set('Cache-Control', 'no-cache');
parent::prepare($request); return parent::prepare($request);
} }
/** /**