Skip to content

Commit

Permalink
Naming, immutable array manipulation
Browse files Browse the repository at this point in the history
This is a sqashed version to add back the changes from reactphp#37:
- 2ab98d2
- 75ff84a
  • Loading branch information
cboden authored and clue committed Aug 9, 2016
1 parent 82bc9e3 commit 545b05f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/RequestHeaderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ public function parseRequest($data)
parse_str($queryString, $parsedQuery);
}

$headers = $psrRequest->getHeaders();
array_walk($headers, function(&$val) {
$headers = array_map(function($val) {
if (1 === count($val)) {
$val = $val[0];
}
});

return $val;
}, $psrRequest->getHeaders());

$request = new Request(
$psrRequest->getMethod(),
Expand Down

0 comments on commit 545b05f

Please sign in to comment.