diff --git a/src/Endpoints/Crypto.php b/src/Endpoints/Crypto.php index 43ae35a..d8077a7 100644 --- a/src/Endpoints/Crypto.php +++ b/src/Endpoints/Crypto.php @@ -25,11 +25,9 @@ class Crypto implements API 'zones/' . $zoneID . '/settings/ssl' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result->value; } - return false; } @@ -45,11 +43,9 @@ class Crypto implements API 'zones/' . $zoneID . '/ssl/verification' ); $body = json_decode($return->getBody()); - if ($body->result) { return $body->result; } - return false; } @@ -65,11 +61,9 @@ class Crypto implements API 'zones/' . $zoneID . '/settings/opportunistic_encryption' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result->value; } - return false; } @@ -85,11 +79,9 @@ class Crypto implements API 'zones/' . $zoneID . '/settings/opportunistic_onion' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result; } - return false; } @@ -99,11 +91,9 @@ class Crypto implements API 'zones/' . $zoneID . '/settings/always_use_https' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result->value; } - return false; } @@ -113,11 +103,9 @@ class Crypto implements API 'zones/' . $zoneID . '/settings/automatic_https_rewrites' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result->value; } - return false; } @@ -137,11 +125,9 @@ class Crypto implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } @@ -161,11 +147,9 @@ class Crypto implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } @@ -185,14 +169,19 @@ class Crypto implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } + /** + * Update the Oppurtunistic Encryption setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ public function updateOpportunisticEncryptionSetting($zoneID, $value) { $return = $this->adapter->patch( @@ -202,14 +191,19 @@ class Crypto implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } + /** + * Update the Onion Routing setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ public function updateOnionRoutingSetting($zoneID, $value) { $return = $this->adapter->patch( @@ -219,11 +213,9 @@ class Crypto implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } } diff --git a/src/Endpoints/TLS.php b/src/Endpoints/TLS.php index 9e98295..6b8bc1f 100644 --- a/src/Endpoints/TLS.php +++ b/src/Endpoints/TLS.php @@ -19,20 +19,30 @@ class TLS implements API $this->adapter = $adapter; } + /** + * Get the TLS Client Auth setting for the zone + * + * @param string $zoneID The ID of the zone + * @return string|false + */ public function getTLSClientAuth($zoneID) { $return = $this->adapter->get( 'zones/' . $zoneID . '/settings/tls_client_auth' ); $body = json_decode($return->getBody()); - if ($body->success) { return $body->result->value; } - return false; } + /** + * Enable TLS 1.3 for the zone + * + * @param string $zoneID The ID of the zone + * @return bool + */ public function enableTLS13($zoneID) { $return = $this->adapter->patch( @@ -40,14 +50,18 @@ class TLS implements API ['value' => 'on'] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } + /** + * Disable TLS 1.3 for the zone + * + * @param string $zoneID The ID of the zone + * @return bool + */ public function disableTLS13($zoneID) { $return = $this->adapter->patch( @@ -55,15 +69,19 @@ class TLS implements API ['value' => 'off'] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } - + /** + * Update the minimum TLS version setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $minimumVersion The version to update to + * @return bool + */ public function changeMinimumTLSVersion($zoneID, $minimumVersion) { $return = $this->adapter->patch( @@ -73,14 +91,19 @@ class TLS implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; } + /** + * Update the TLS Client Auth setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ public function updateTLSClientAuth($zoneID, $value) { $return = $this->adapter->patch( @@ -90,11 +113,9 @@ class TLS implements API ] ); $body = json_decode($return->getBody()); - if ($body->success) { return true; } - return false; }