From 528dca66aa132187fbf5fa3b2c8c67ec1984d014 Mon Sep 17 00:00:00 2001 From: Massimo Conti <conti@nimaia.it> Date: Thu, 1 Jul 2021 10:37:34 +0200 Subject: [PATCH 1/2] Making omnisendApi protected to let the class being subclassable --- src/Omnisend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Omnisend.php b/src/Omnisend.php index 4145cea..393c2f9 100644 --- a/src/Omnisend.php +++ b/src/Omnisend.php @@ -191,7 +191,7 @@ public function delete($endpoint, $queryParams = array()) return $this->omnisendApi($endpoint, 'DELETE', '', $queryParams); } - private function omnisendApi($endpoint, $method = "POST", $fields = array(), $queryParams = array()) + protected function omnisendApi($endpoint, $method = "POST", $fields = array(), $queryParams = array()) { $this->numberOfCurlRepeats++; $this->lastError = array(); @@ -285,7 +285,7 @@ private function omnisendApi($endpoint, $method = "POST", $fields = array(), $qu ); } else { if ($this->numberOfCurlRepeats == 1 && ($status == 408 || $status == 429 || $status == 503)) { - $result = self::omnisendApi($endpoint, $method, $fields, $queryParams); + $result = $this->omnisendApi($endpoint, $method, $fields, $queryParams); } elseif ($status >= 200 && $status < 300) { if ($response && !empty($response)) { return json_decode($response, true); From 2346d4582a62d9f9aa4ecddd54f9fd4424d51d4b Mon Sep 17 00:00:00 2001 From: Massimo Conti <conti@nimaia.it> Date: Thu, 1 Jul 2021 10:44:52 +0200 Subject: [PATCH 2/2] Fix properties modifiers --- src/Omnisend.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Omnisend.php b/src/Omnisend.php index 393c2f9..4ea929c 100644 --- a/src/Omnisend.php +++ b/src/Omnisend.php @@ -11,14 +11,14 @@ class Omnisend { - private $apiKey; - private $apiUrl = 'https://api.omnisend.com/v3/'; - private $timeout; - private $numberOfCurlRepeats = 0; - private $verifySSL = true; - private $lastError = array(); - private $useCurl = true; - private $version = "1.2"; + protected $apiKey; + protected $apiUrl = 'https://api.omnisend.com/v3/'; + protected $timeout; + protected $numberOfCurlRepeats = 0; + protected $verifySSL = true; + protected $lastError = array(); + protected $useCurl = true; + protected $version = "1.2"; public function __construct($apiKey, $options = array()) {