Merge pull request #24478 from agh1/5.53.0-releasenotes-final
[civicrm-core.git] / guzzle_php81_shim.php
CommitLineData
9584d5d5
SL
1<?php
2
3namespace GuzzleHttp;
4
df54c640
SL
5try {
6 \Composer\InstalledVersions::getVersion('drupal/core');
7 $drupalCoreInstalled = TRUE;
8}
9catch (\OutOfBoundsException $e) {
10 $drupalCoreInstalled = FALSE;
11}
12
13if (!$drupalCoreInstalled) {
9584d5d5
SL
14
15 /**
16 * Generates URL-encoded query string.
17 *
18 * This shim exists to make Guzzle 6 PHP 8.1 compatible.
19 *
20 * @link https://php.net/manual/en/function.http-build-query.php
21 *
22 * @param object|array $data
23 * May be an array or object containing properties.
24 * @param string|null $numeric_prefix
25 * (optional) If numeric indices are used in the base array and this parameter
26 * is provided, it will be prepended to the numeric index for elements in
27 * the base array only.
28 * @param string|null $arg_separator [optional] <p>
29 * (optional) arg_separator.output is used to separate arguments, unless this
30 * parameter is specified, and is then used.
31 * @param int $encoding_type
32 * (optional) By default, PHP_QUERY_RFC1738.
33 *
34 * @return string
35 * A URL-encoded string.
36 */
37 function http_build_query($data, $numeric_prefix = '', $arg_separator = '&', $encoding_type = \PHP_QUERY_RFC1738) {
38 return \http_build_query($data, is_null($numeric_prefix) ? '' : $numeric_prefix, $arg_separator, $encoding_type);
39 }
40
41}