mirror of
https://github.com/ovh/php-ovh.git
synced 2023-11-05 03:20:26 +01:00
Remove a direct client call, use API get
method.
Remove the `$this->http_client->get()` call used in the `calculateTimeDelta` method. This call is too coupled to the HttpClient, using the same method for all the calls is always better. Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
This commit is contained in:
parent
940ec307fb
commit
9703ee3cdd
@ -165,8 +165,13 @@ class Api
|
|||||||
private function calculateTimeDelta()
|
private function calculateTimeDelta()
|
||||||
{
|
{
|
||||||
if (!isset($this->time_delta)) {
|
if (!isset($this->time_delta)) {
|
||||||
$response = $this->http_client->get($this->endpoint . "/auth/time");
|
$response = $this->rawCall(
|
||||||
$serverTimestamp = (int)(String)$response->getBody();
|
'GET',
|
||||||
|
"/auth/time",
|
||||||
|
null,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
$serverTimestamp = (int)(string)$response->getBody();
|
||||||
$this->time_delta = $serverTimestamp - (int)\time();
|
$this->time_delta = $serverTimestamp - (int)\time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user