Skip to content

Commit

Permalink
PHP 8.1 compat: Passing null to argument guzzle#2 for http_build_quer…
Browse files Browse the repository at this point in the history
…y is deprecated.
  • Loading branch information
chrisdeeming committed Nov 29, 2021
1 parent 5c9b91f commit aaf39c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Expand Up @@ -307,7 +307,7 @@ private function applyOptions(RequestInterface $request, array &$options)
. 'x-www-form-urlencoded requests, and the multipart '
. 'option to send multipart/form-data requests.');
}
$options['body'] = http_build_query($options['form_params'], '', '&');
$options['body'] = http_build_query($options['form_params']);
unset($options['form_params']);
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
Expand Down Expand Up @@ -368,7 +368,7 @@ private function applyOptions(RequestInterface $request, array &$options)
if (isset($options['query'])) {
$value = $options['query'];
if (is_array($value)) {
$value = http_build_query($value, null, '&', PHP_QUERY_RFC3986);
$value = http_build_query($value, '', '&', PHP_QUERY_RFC3986);
}
if (!is_string($value)) {
throw new \InvalidArgumentException('query must be a string or array');
Expand Down

0 comments on commit aaf39c0

Please sign in to comment.