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

@@ -50,13 +50,12 @@ 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());
@@ -67,35 +66,41 @@ 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());
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());
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());
@@ -106,11 +111,13 @@ 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());

View File

@@ -18,72 +18,86 @@ class ZoneSettings implements API
{
$this->adapter = $adapter;
}
public function getMinifySetting($zoneID) {
public function getMinifySetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/minify'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function getRocketLoaderSetting($zoneID) {
public function getRocketLoaderSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/rocket_loader'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function getAlwaysOnlineSetting($zoneID) {
public function getAlwaysOnlineSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/always_online'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function getEmailObfuscationSetting($zoneID) {
public function getEmailObfuscationSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/email_obfuscation'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function getHotlinkProtectionSetting($zoneID) {
public function getHotlinkProtectionSetting($zoneID)
{
$return = $this->adapter->get(
'zones/' . $zoneID . '/settings/hotlink_protection'
);
$body = json_decode($return->getBody());
if ($body->success) {
return $body->result;
return $body->result->value;
}
return false;
}
public function updateMinifySetting($zoneID, $html, $css, $js) {
public function updateMinifySetting($zoneID, $html, $css, $js)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/minify', [
'value' => [
'html' => $html,
'css' => $css,
'js' => $js
'js' => $js,
],
]
);
$body = json_decode($return->getBody());
@@ -94,10 +108,12 @@ class ZoneSettings implements API
return false;
}
public function updateRocketLoaderSetting($zoneID, $value) {
public function updateRocketLoaderSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/rocket_loader', [
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());
@@ -108,10 +124,12 @@ class ZoneSettings implements API
return false;
}
public function updateAlwaysOnlineSetting($zoneID, $value) {
public function updateAlwaysOnlineSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/always_online', [
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());
@@ -122,10 +140,12 @@ class ZoneSettings implements API
return false;
}
public function updateEmailObfuscationSetting($zoneID, $value) {
public function updateEmailObfuscationSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/email_obfuscation', [
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());
@@ -136,10 +156,12 @@ class ZoneSettings implements API
return false;
}
public function updateHotlinkProtectionSetting($zoneID, $value) {
public function updateHotlinkProtectionSetting($zoneID, $value)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/hotlink_protection', [
'value' => $value
'value' => $value,
]
);
$body = json_decode($return->getBody());