Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mime] added Headers::toArray() #30484

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

Merged
merged 1 commit into from
Mar 8, 2019
Merged

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Mar 8, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

That helps when using the Mime component to create a form submission HTTP body (where you need to merge the headers of the MIME body with the HTTP headers):

$body->getPreparedHeaders()->toArray();

vs

foreach ($body->getPreparedHeaders()->getAll() as $header) {
      $headers[] = $header->toString();
}

@fabpot fabpot force-pushed the mime-headers-toarray branch from 2dc9e28 to 788bb81 Compare March 8, 2019 07:20
@fabpot fabpot merged commit 788bb81 into symfony:master Mar 8, 2019
fabpot added a commit that referenced this pull request Mar 8, 2019
This PR was merged into the 4.3-dev branch.

Discussion
----------

[Mime] added Headers::toArray()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

That helps when using the Mime component to create a form submission HTTP body (where you need to merge the headers of the MIME body with the HTTP headers):

```php
$body->getPreparedHeaders()->toArray();

vs

foreach ($body->getPreparedHeaders()->getAll() as $header) {
      $headers[] = $header->toString();
}
```

Commits
-------

788bb81 [Mime] added Headers::toArray()
@fabpot fabpot deleted the mime-headers-toarray branch March 17, 2019 07:41
@fabpot fabpot mentioned this pull request May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants