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
[HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content #15249
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); | ||
} | ||
|
||
if (true === $asResource) { | ||
if (is_resource($this->content)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can reuse $currentContentIsResource
… resources from string content.
dunglas
force-pushed
the
fix_test_content_stream
branch
from
July 16, 2015 06:06
f0a48ed
to
eb80fbb
Compare
Should be OK now. |
|
||
// Content passed in parameter (test) | ||
if (is_string($this->content)) { | ||
$resource = fopen('php://temp','r+'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space after the comma.
👍 |
1 similar comment
👍 |
Thank you @dunglas. |
fabpot
added a commit
that referenced
this pull request
Jul 16, 2015
… body and to return resources from string content (dunglas) This PR was squashed before being merged into the 2.3 branch (closes #15249). Discussion ---------- [HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | not yet * Allows to fix tests of https://github.com/symfony/psr-http-message-bridge with PHP 5.6. * Ease the transition to PSR-7 (in PSR-7, almost everything is stream - #15186) Maybe should I open it against 2.8 but it can be considered a bug fix at least for the part "returning a string as a resource". Commits ------- 059964d [HttpFoundation] [PSR-7] Allow to use resources as content body and to return resources from string content
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maybe should I open it against 2.8 but it can be considered a bug fix at least for the part "returning a string as a resource".