Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-- using Query::class insted of build_query() #4

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\RequestException;
use function GuzzleHttp\Psr7\build_query;
use GuzzleHttp\Psr7\Query;
use GuzzleHttp\Psr7\Uri;
use LinkedIn\Http\Method;

Expand Down Expand Up @@ -515,7 +515,7 @@ protected function buildUrl($endpoint, $params)
$scheme,
$authority,
$path,
build_query($params),
Query::build($params),
$fragment
);
return $uri;
Expand Down Expand Up @@ -545,7 +545,7 @@ public function api($endpoint, array $params = [], $method = Method::GET)
'headers' => $headers,
]);
if (!empty($params) && Method::GET === $method) {
$endpoint .= '?' . build_query($params);
$endpoint .= '?' . Query::build($params);
}

try {
Expand Down Expand Up @@ -647,7 +647,7 @@ protected function prepareOptions(array $params, bool $rawData = false)
{
$options = [];
if ($rawData) {
$options['body'] = build_query($params, false);
$options['body'] = Query::build($params, false);
return $options;
}
$options['body'] = \GuzzleHttp\json_encode($params);
Expand Down