|
15 | 15 | use chillerlan\OAuth\Core\{AccessToken, OAuthProvider, ProviderException}; |
16 | 16 | use Psr\Http\Message\{RequestInterface, ResponseInterface, UriInterface}; |
17 | 17 |
|
18 | | -use function array_merge, http_build_query, in_array, is_array,ksort, md5; |
19 | | -use function chillerlan\HTTP\Psr7\{get_json, merge_query}; |
| 18 | +use function array_merge, in_array, is_array, ksort, md5; |
| 19 | +use function chillerlan\HTTP\Utils\get_json; |
20 | 20 |
|
21 | 21 | use const PHP_QUERY_RFC1738; |
22 | 22 |
|
@@ -109,7 +109,7 @@ public function getAuthURL(array $params = null):UriInterface{ |
109 | 109 | 'api_key' => $this->options->key, |
110 | 110 | ]); |
111 | 111 |
|
112 | | - return $this->uriFactory->createUri(merge_query($this->authURL, $params)); |
| 112 | + return $this->uriFactory->createUri($this->mergeQuery($this->authURL, $params)); |
113 | 113 | } |
114 | 114 |
|
115 | 115 | /** |
@@ -148,7 +148,7 @@ public function getAccessToken(string $session_token):AccessToken{ |
148 | 148 | $params['api_sig'] = $this->getSignature($params); |
149 | 149 |
|
150 | 150 | /** @phan-suppress-next-line PhanTypeMismatchArgumentNullable */ |
151 | | - $request = $this->requestFactory->createRequest('GET', merge_query($this->apiURL, $params)); |
| 151 | + $request = $this->requestFactory->createRequest('GET', $this->mergeQuery($this->apiURL, $params)); |
152 | 152 |
|
153 | 153 | return $this->parseTokenResponse($this->http->sendRequest($request)); |
154 | 154 | } |
@@ -214,15 +214,15 @@ public function request( |
214 | 214 | } |
215 | 215 |
|
216 | 216 | /** @phan-suppress-next-line PhanTypeMismatchArgumentNullable */ |
217 | | - $request = $this->requestFactory->createRequest($method, merge_query($this->apiURL, $params)); |
| 217 | + $request = $this->requestFactory->createRequest($method, $this->mergeQuery($this->apiURL, $params)); |
218 | 218 |
|
219 | 219 | foreach(array_merge($this->apiHeaders, $headers ?? []) as $header => $value){ |
220 | 220 | $request = $request->withAddedHeader($header, $value); |
221 | 221 | } |
222 | 222 |
|
223 | 223 | if($method === 'POST'){ |
224 | 224 | $request = $request->withHeader('Content-Type', 'application/x-www-form-urlencoded'); |
225 | | - $body = $this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738)); |
| 225 | + $body = $this->streamFactory->createStream($this->buildQuery($body, PHP_QUERY_RFC1738)); |
226 | 226 | $request = $request->withBody($body); |
227 | 227 | } |
228 | 228 |
|
|
0 commit comments