Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit d6a0523

Browse files
committed
:octocat: i hate it.
1 parent 3cc46be commit d6a0523

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/Core/OAuthProvider.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ public function __call(string $name, array $arguments):ResponseInterface{
234234
$params = [];
235235
}
236236

237-
# $body = Psr7\clean_query_params($body); // @todo
237+
$body = $this->cleanBodyParams($body);
238238
}
239239

240-
$params = Psr7\clean_query_params($params);
240+
$params = $this->cleanQueryParams($params);
241241

242242
$this->logger->debug('OAuthProvider::__call() -> '.(new ReflectionClass($this))->getShortName().'::'.$name.'()', [
243243
'$endpoint' => $endpoint, '$params' => $params, '$method' => $method, '$body' => $body, '$headers' => $headers,
@@ -246,6 +246,24 @@ public function __call(string $name, array $arguments):ResponseInterface{
246246
return $this->request($endpoint, $params, $method, $body, $headers);
247247
}
248248

249+
/**
250+
* @param array $params
251+
*
252+
* @return array
253+
*/
254+
protected function cleanQueryParams(array $params):array{
255+
return Psr7\clean_query_params($params, Psr7\BOOLEANS_AS_INT_STRING, true);
256+
}
257+
258+
/**
259+
* @param array $params
260+
*
261+
* @return array
262+
*/
263+
protected function cleanBodyParams(array $params):array{
264+
return Psr7\clean_query_params($params, Psr7\BOOLEANS_AS_BOOL, true);
265+
}
266+
249267
/**
250268
* @param string $path
251269
* @param array $params

0 commit comments

Comments
 (0)