From 5f8d2e18327d0dff75c644ff1ec1c037710a4d3d Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Sat, 25 Nov 2017 01:13:27 +0300 Subject: [PATCH 1/3] add ssl verification method (https://api.cloudflare.com/#ssl-verification-get-ssl-verification) --- src/CloudFlare/Zone/SSL.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/CloudFlare/Zone/SSL.php b/src/CloudFlare/Zone/SSL.php index 5939d2f..0ddf735 100644 --- a/src/CloudFlare/Zone/SSL.php +++ b/src/CloudFlare/Zone/SSL.php @@ -15,6 +15,21 @@ */ class SSL extends Api { + /** + * Get SSL Verification permission needed: #ssl:read + * + * @param string $zone_identifier API item identifier tag + * @param string $retry Immediately retry SSL Verification + */ + public function verification($zone_identifier, $retry = null) + { + $data = [ + 'retry' => $retry, + ]; + + return $this->get('zones/'.$zone_identifier.'/ssl/verification', $data); + } + /** * List SSL configurations (permission needed: #ssl:read) * From 544031e3ae19b03edda4107855052b26f65c7550 Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Sat, 25 Nov 2017 01:25:24 +0300 Subject: [PATCH 2/3] make StyleCI happy --- src/CloudFlare/Zone/SSL.php | 2 +- src/CloudFlare/Zone/Settings.php | 8 ++++---- tests/ApiTest.php | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CloudFlare/Zone/SSL.php b/src/CloudFlare/Zone/SSL.php index 0ddf735..904c57f 100644 --- a/src/CloudFlare/Zone/SSL.php +++ b/src/CloudFlare/Zone/SSL.php @@ -19,7 +19,7 @@ class SSL extends Api * Get SSL Verification permission needed: #ssl:read * * @param string $zone_identifier API item identifier tag - * @param string $retry Immediately retry SSL Verification + * @param string $retry Immediately retry SSL Verification */ public function verification($zone_identifier, $retry = null) { diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index c9caf0d..7ce3fe6 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -74,7 +74,7 @@ public function always_online($zone_identifier) */ public function always_use_https($zone_identifier) { - return $this->get('zones/' . $zone_identifier . '/settings/always_use_https'); + return $this->get('zones/'.$zone_identifier.'/settings/always_use_https'); } /** @@ -458,9 +458,9 @@ public function change_always_on($zone_identifier, $value = null) */ public function change_always_use_https($zone_identifier, $value = null) { - $data = array( - 'value' => $value - ); + $data = [ + 'value' => $value, + ]; return $this->patch('zones/' . $zone_identifier . '/settings/always_use_https', $data); } diff --git a/tests/ApiTest.php b/tests/ApiTest.php index e486a36..4a7ec2d 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -50,6 +50,7 @@ public function testSetCurlOption() public function testHttpNoCredentials() { $http = new Api(); + try { $http->get('test'); $this->fail('Expected exception not thrown'); From c3dff7026be0b3610a101bde6f3adea72e4c404f Mon Sep 17 00:00:00 2001 From: Aleksei Faians Date: Sat, 25 Nov 2017 01:29:23 +0300 Subject: [PATCH 3/3] make StyleCI happy, again --- src/CloudFlare/Zone/Settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CloudFlare/Zone/Settings.php b/src/CloudFlare/Zone/Settings.php index 7ce3fe6..a22bb18 100644 --- a/src/CloudFlare/Zone/Settings.php +++ b/src/CloudFlare/Zone/Settings.php @@ -461,7 +461,8 @@ public function change_always_use_https($zone_identifier, $value = null) $data = [ 'value' => $value, ]; - return $this->patch('zones/' . $zone_identifier . '/settings/always_use_https', $data); + + return $this->patch('zones/'.$zone_identifier.'/settings/always_use_https', $data); } /**