You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #59154 [HttpFoundation] Support iterable of string in StreamedResponse (mtarld)
This PR was merged into the 7.3 branch.
Discussion
----------
[HttpFoundation] Support iterable of string in `StreamedResponse`
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues |
| License | MIT
Improve DX by supporting iterable of string in `StreamedResponse` so that it's more convenient streaming a list of strings.
Before:
```php
$iterable = ['foo, 'bar', 'baz'];
$response = new StreamedResponse(function () use ($iterable): void {
foreach ($iterable as $chunk) {
echo $chunk;
}
});
```
After:
```php
$iterable = ['foo, 'bar', 'baz'];
$response = new StreamedResponse($iterable);
```
Commits
-------
7e4178a [HttpFoundation] Support iterable of string in `StreamedResponse`
0 commit comments