cast response as array instead of object

This commit is contained in:
Kyle Yee
2019-01-28 11:39:49 +08:00
parent fb45932677
commit 44eb77f9ca

View File

@@ -41,21 +41,21 @@ class Accounts implements API
return (object)['result' => $this->body->result, 'result_info' => $this->body->result_info];
}
public function getDomains(string $accountID): \stdClass
public function getDomains(string $accountID): array
{
$response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains');
$this->body = $response->getBody();
$this->body = json_decode($response->getBody());
return (object)['result' => $this->body->result];
return $this->body->result;
}
public function getDomainDetails(string $accountID, string $domainName): \stdClass
public function getDomainDetails(string $accountID, string $domainName): array
{
$response = $this->adapter->get('accounts/' . $accountID . '/registrar/domains' . $domainName);
$this->body = $response->getBody();
$this->body = json_decode($response->getBody());
return (object)['result' => $this->body->result];
return $this->body->result;
}
}