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

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

Merged
merged 1 commit into from Mar 8, 2019

Conversation

Projects
None yet
3 participants
@fabpot
Copy link
Member

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 fabpot:mime-headers-toarray branch from 2dc9e28 to 788bb81 Mar 8, 2019

@fabpot fabpot merged commit 788bb81 into symfony:master Mar 8, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Mar 8, 2019

feature #30484 [Mime] added Headers::toArray() (fabpot)
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 fabpot:mime-headers-toarray branch Mar 17, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.