We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d65736b commit a91a558Copy full SHA for a91a558
src/HeaderUtil.php
@@ -103,7 +103,7 @@ public static function normalize(iterable $headers):array{
103
public static function trimValues(iterable $values):iterable{
104
105
foreach($values as &$value){
106
- $value = trim($value, " \t");
+ $value = trim((string)($value ?? ''), " \t");
107
}
108
109
return $values;
tests/HeaderUtilTest.php
@@ -113,4 +113,8 @@ public function testNormalizeHeaderName(string $name, string $expected):void{
113
$this::assertSame($expected, HeaderUtil::normalizeHeaderName($name));
114
115
116
+ public function testTrimValues():void{
117
+ $this::assertSame(['69', '420'], HeaderUtil::trimValues([69, ' 420 ']));
118
+ }
119
+
120
0 commit comments