Skip to content

Commit 545b05f

Browse files
cbodenclue
authored andcommitted
Naming, immutable array manipulation
This is a sqashed version to add back the changes from reactphp#37: - 2ab98d2 - 75ff84a
1 parent 82bc9e3 commit 545b05f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/RequestHeaderParser.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ public function parseRequest($data)
4444
parse_str($queryString, $parsedQuery);
4545
}
4646

47-
$headers = $psrRequest->getHeaders();
48-
array_walk($headers, function(&$val) {
47+
$headers = array_map(function($val) {
4948
if (1 === count($val)) {
5049
$val = $val[0];
5150
}
52-
});
51+
52+
return $val;
53+
}, $psrRequest->getHeaders());
5354

5455
$request = new Request(
5556
$psrRequest->getMethod(),

0 commit comments

Comments
 (0)