Skip to content

Commit d21728d

Browse files
feature #32122 [HttpFoundation] deprecate HeaderBag::get() returning an array and add all($key) instead (Simperfit)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation] deprecate HeaderBag::get() returning an array and add all($key) instead | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | maybe <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #31317 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | todo <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> the $first param has been deprecated in the get methid and we are adding a $key parameter to all to get all values from a key as arrays Do we deprecated the get method ? if so this will be a little bigger in terms of changes. Commits ------- 2c5a8f1bdf [HttpFoundation] deprecate using $first in get and added key in all
2 parents e8e738f + 19df844 commit d21728d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/EventListener/AddLinkHeaderListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testOnKernelResponse()
4747
'</foo>; rel="preload"',
4848
];
4949

50-
$this->assertEquals($expected, $response->headers->get('Link', null, false));
50+
$this->assertEquals($expected, $response->headers->all()['link']);
5151
}
5252

5353
public function testSubscribedEvents()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"symfony/http-kernel": ""
2525
},
2626
"require-dev": {
27-
"symfony/http-foundation": "^3.4|^4.0|^5.0",
27+
"symfony/http-foundation": "^4.4|^5.0",
2828
"symfony/http-kernel": "^4.3|^5.0"
2929
},
3030
"conflict": {

0 commit comments

Comments
 (0)