mirror of
https://github.com/ovh/php-ovh.git
synced 2023-11-05 03:20:26 +01:00
fix: hook that modify Guzzle parameters serialization when true/false value
Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
This commit is contained in:
parent
57ba00310d
commit
d3bd44ed68
14
src/Api.php
14
src/Api.php
@ -235,6 +235,20 @@ class Api
|
||||
}
|
||||
|
||||
$query = array_merge($query, (array)$content);
|
||||
|
||||
// rewrite query args to properly dump true/false parameters
|
||||
foreach($query as $key => $value)
|
||||
{
|
||||
if ($value === false)
|
||||
{
|
||||
$query[$key] = "false";
|
||||
}
|
||||
elseif ($value === true)
|
||||
{
|
||||
$query[$key] = "true";
|
||||
}
|
||||
}
|
||||
|
||||
$query = \GuzzleHttp\Psr7\build_query($query);
|
||||
|
||||
$url = $request->getUri()->withQuery($query);
|
||||
|
@ -364,7 +364,7 @@ class ApiTest extends \PHPUnit_Framework_TestCase
|
||||
//}));
|
||||
|
||||
$api = new Api($this->application_key, $this->application_secret, $this->endpoint, $this->consumer_key, $this->client);
|
||||
$api->get('/me/api/credential', ['dryRun' => true, 'noDryRun' => false]);
|
||||
$api->get('/me/api/credential', ['dryRun' => true, 'notDryRun' => false]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user