MessageTrait: Fixed HeaderBag::get parameter deprecation in Symfony 4.4

This commit is contained in:
Igor Scheller 2019-11-22 11:15:27 +01:00
parent 9a170c82cb
commit 5704174fe6
2 changed files with 6 additions and 1 deletions

View File

@ -111,7 +111,7 @@ trait MessageTrait
*/ */
public function getHeader($name) public function getHeader($name)
{ {
return $this->headers->get($name, null, false); return $this->headers->all($name);
} }
/** /**

View File

@ -74,6 +74,11 @@ class MessageTraitResponseTest extends TestCase
$this->assertEquals(['bar'], $newMessage->getHeader('Foo')); $this->assertEquals(['bar'], $newMessage->getHeader('Foo'));
$this->assertEquals([], $newMessage->getHeader('LoremIpsum')); $this->assertEquals([], $newMessage->getHeader('LoremIpsum'));
$newMessage = $message
->withHeader('foo', 'bar')
->withAddedHeader('foo', 'batz');
$this->assertEquals(['bar', 'batz'], $newMessage->getHeader('foo'));
} }
/** /**