Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Apr 18, 2012
Merged

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

merged 1 commit into from Apr 18, 2012

Conversation

Crell
Copy link
Contributor

@Crell Crell commented Apr 15, 2012

Currently, Response::prepare() returns nothing, ever. That's such a waste. This one-liner returns $this, so that the method may be chained. That allows for, for instance:

$kernel->handle($request)->prepare($request)->send();

@@ -237,6 +237,7 @@ public function prepare(Request $request)
$headers->set('Content-Length', $length);
}
}
return $this;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add an empty line before the return statement, and update the phpdoc

@Crell
Copy link
Contributor Author

Crell commented Apr 15, 2012

Done and done.

@vicb
Copy link
Contributor

vicb commented Apr 16, 2012

@Crell
Copy link
Contributor Author

Crell commented Apr 17, 2012

Fixed and squished.

fabpot added a commit that referenced this pull request Apr 18, 2012
Commits
-------

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

Discussion
----------

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

Currently, Response::prepare() returns nothing, ever.  That's such a waste.  This one-liner returns $this, so that the method may be chained.  That allows for, for instance:

$kernel->handle($request)->prepare($request)->send();

---------------------------------------------------------------------------

by Crell at 2012-04-15T23:48:44Z

Done and done.

---------------------------------------------------------------------------

by vicb at 2012-04-16T06:05:08Z

Please update https://github.com/Crell/symfony/blob/e05fbf19a9dca656f89e4f8396e7c7e80f221eba/src/Symfony/Component/HttpFoundation/StreamedResponse.php#L77 and squash your commits. thanks.

---------------------------------------------------------------------------

by Crell at 2012-04-17T00:26:07Z

Fixed and squished.
@fabpot fabpot merged commit a0d047b into symfony:master Apr 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants