Skip to content

Commit

Permalink
fixup! Soothe SA
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Jan 6, 2024
1 parent 6cba936 commit 3ef35b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/QueryMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ public function __invoke(string $uri, array $query): Uri
$path = (string) parse_url($uri, PHP_URL_PATH);
$uriQueryString = (string) parse_url($uri, PHP_URL_QUERY);
parse_str($uriQueryString, $uriQuery);
/** @var array<string, mixed> $uriQuery */
$mergedQuery = $uriQuery + $query;
$uriQueryKeyString = [];
foreach ($uriQuery as $key => $value) {
$uriQueryKeyString[(string) $key] = $value;
}

$mergedQuery = $uriQueryKeyString + $query;

return new Uri($path, $mergedQuery);
}
Expand Down

0 comments on commit 3ef35b2

Please sign in to comment.