Skip to content

Commit

Permalink
Merge pull request #2 from LUMASERV/analysis-z3GQmP
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
LUMASERV authored Sep 2, 2016
2 parents 3fa1e2e + 7a859f4 commit 510cd49
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/LUMASERV.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ private function request($actionPath, $params = [], $method = 'GET')
case 'GET':
return $this->getHttpClient()->get($url, [
'verify' => false,
'query' => $params
'query' => $params,
]);
break;
case 'POST':
return $this->getHttpClient()->post($url, [
'verify' => false,
'body' => $params
'body' => $params,
]);
break;
case 'PUT':
return $this->getHttpClient()->put($url, [
'verify' => false,
'body' => $params
'body' => $params,
]);
case 'DELETE':
return $this->getHttpClient()->delete($url, [
'verify' => false,
'body' => $params
'body' => $params,
]);
default:
throw new MalformedParameterException('Wrong HTTP method passed');
Expand All @@ -116,10 +116,11 @@ private function processRequest($response)
{
$response = $response->getBody()->__toString();
$result = json_decode($response);
if (json_last_error() == JSON_ERROR_NONE)
if (json_last_error() == JSON_ERROR_NONE) {
return $result;
else
} else {
return $response;
}
}

public function get($actionPath, $params = [])
Expand Down Expand Up @@ -160,14 +161,16 @@ public function getAllDomains()
return $this->get('domains');
}

public function isDomainAvailable($sld, $tld) {
public function isDomainAvailable($sld, $tld)
{
return $this->get('domains/check', [
'sld' => $sld,
'tld' => $tld
'tld' => $tld,
]);
}

public function getDomainPrices() {
public function getDomainPrices()
{
return $this->get('domains/prices');
}
}

0 comments on commit 510cd49

Please sign in to comment.