Updated to PSR-2

This commit is contained in:
Paul Adams
2019-02-26 20:06:07 +00:00
parent f105d38d85
commit 9d434a23b3
2 changed files with 78 additions and 49 deletions

View File

@@ -25,7 +25,7 @@ class TLS implements API
'zones/' . $zoneID . '/settings/tls_1_3',
['value' => 'on']
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return true;
@@ -40,7 +40,7 @@ class TLS implements API
'zones/' . $zoneID . '/settings/tls_1_3',
['value' => 'off']
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return true;
@@ -50,16 +50,15 @@ class TLS implements API
}
public function changeMinimumTLSVersion($zoneID, $minimumVersion)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/min_tls_version',
[
'value' => $minimumVersion
'value' => $minimumVersion,
]
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return true;
@@ -67,38 +66,44 @@ class TLS implements API
return false;
}
public function getHTTPSRedirectStatus($zoneID) {
public function getHTTPSRedirectSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/always_use_https'
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function getHTTPSRewritesStatus($zoneID) {
public function getHTTPSRewritesSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/automatic_https_rewrites'
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function updateHTTPSRedirects($zoneID, $value) {
public function updateHTTPSRedirectStatus($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/always_use_https',
[
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return true;
@@ -106,14 +111,16 @@ class TLS implements API
return false;
}
public function updateHTTPSRewrites($zoneID, $value) {
public function updateHTTPSRewritesStatus($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/automatic_https_rewrites',
[
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());
$body = json_decode($return->getBody());
if ($body->success) {
return true;