diff --git a/CHANGELOG.md b/CHANGELOG.md index c63179b..5f739b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ # Release Notes for KlaviyoConnect +## 4.0.11 - 2022-06-29 +### Fixed -## 5.0.0 - 2022-06-15 - -- Separate Craft 4 version +- Fixed issue with use of mixed return types on PHP 7.x +- Fixed deprecated use of parseEnv() +- Fixed formatting of this changelog ## 4.0.10 - 2022-06-13 -## Added +### Added - Added a service method to retrieve a Klaviyo Person ID using an email address - Added a service method to update a Klaviyo profile @@ -14,7 +16,7 @@ ## 4.0.9 - 2022-06-07 -## Fixed +### Fixed - Fixes issue in Lists field type where list selection isn't saved, or previous setting is nulled, if the entry is first saved by an automatic draft. diff --git a/src/controllers/ApiController.php b/src/controllers/ApiController.php index 7b4c3ec..a16ac38 100644 --- a/src/controllers/ApiController.php +++ b/src/controllers/ApiController.php @@ -29,7 +29,7 @@ class ApiController extends Controller * @access public * @return void */ - public function actionTrack() + public function actionTrack() // no return type as mixed is PHP 8 only { $this->requirePostRequest(); @@ -282,7 +282,7 @@ private function identify(): void * @access private * @return mixed */ - private function forwardOrRedirect() + private function forwardOrRedirect() // no return type as mixed is PHP 8 only { $request = Craft::$app->getRequest(); $forwardUrl = $request->getParam('forward'); @@ -302,7 +302,7 @@ private function forwardOrRedirect() * @access private * @return mixed */ - private function mapProfile() + private function mapProfile() // no return type as mixed is PHP 8 only { $request = Craft::$app->getRequest(); $profileParams = $request->getParam('profile'); diff --git a/src/fields/ListField.php b/src/fields/ListField.php index 601d59d..131a5d1 100644 --- a/src/fields/ListField.php +++ b/src/fields/ListField.php @@ -70,7 +70,7 @@ public function getInputHtml($value, ElementInterface $element = null): string * @param elementinterface $element Default: null * @return mixed */ - public function normalizeValue($value, ElementInterface $element = null) + public function normalizeValue($value, ElementInterface $element = null) // no return type as mixed is PHP 8 only { if ($value) { $o = json_decode($value); diff --git a/src/fields/ListsField.php b/src/fields/ListsField.php index 8fd2779..a1425ba 100644 --- a/src/fields/ListsField.php +++ b/src/fields/ListsField.php @@ -78,7 +78,7 @@ public function getInputHtml($values, ElementInterface $element = null): string * @param elementinterface $element Default: null * @return mixed */ - public function normalizeValue($values, ElementInterface $element = null) + public function normalizeValue($values, ElementInterface $element = null) // no return type as mixed is PHP 8 only { if ($values && !is_array($values)) { $o = json_decode($values); diff --git a/src/models/Base.php b/src/models/Base.php index 6f6a206..c10ea4f 100644 --- a/src/models/Base.php +++ b/src/models/Base.php @@ -62,7 +62,7 @@ public function setCustomProperties($properties): void * @param boolean $recursive Default: true * @return mixed */ - public function toArray(array $fields = [], array $expand = [], $recursive = true) + public function toArray(array $fields = [], array $expand = [], $recursive = true) // no return type as mixed is PHP 8 only { $arr = parent::toArray($fields, $expand, $recursive); diff --git a/src/services/Api.php b/src/services/Api.php index 9ee5219..6faf04c 100644 --- a/src/services/Api.php +++ b/src/services/Api.php @@ -122,7 +122,7 @@ public function getPersonIdfromEmail(string $email): ?string * @param array $params Array of values to update * @return mixed */ - public function updateProfile(string $id, array $params) + public function updateProfile(string $id, array $params) // no return type as mixed is PHP 8 only { $profile = []; @@ -233,7 +233,7 @@ private function encode($params): string * @access public * @return mixed */ - public function getLists() + public function getLists() // no return type as mixed is PHP 8 only { if (is_null($this->cachedLists)) { @@ -294,7 +294,7 @@ public function profileInList($listId, $email): int * @param boolean $useSubscribeEndpoint Default: false * @return mixed */ - public function addProfileToList(KlaviyoList &$list, Profile &$profile, $useSubscribeEndpoint = false) + public function addProfileToList(KlaviyoList &$list, Profile &$profile, $useSubscribeEndpoint = false) // no return type as mixed is PHP 8 only { if (!$profile->hasEmail()) { throw new Exception('You must identify a user by email.'); @@ -329,7 +329,7 @@ public function addProfileToList(KlaviyoList &$list, Profile &$profile, $useSubs * @param mixed $response * @return mixed */ - private function getObjectResponse($response) + private function getObjectResponse($response) // no return type as mixed is PHP 8 only { $content = $response->getBody()->getContents(); if (isset($content)) { diff --git a/src/services/Base.php b/src/services/Base.php index 87eabb9..41f288e 100644 --- a/src/services/Base.php +++ b/src/services/Base.php @@ -20,7 +20,7 @@ abstract class Base extends Component * @param mixed $name * @return mixed */ - protected function getSetting($name) + protected function getSetting($name) // no return type as mixed only works above PHP 8 { if (is_null($this->settings)) { $this->settings = Plugin::getInstance()->settings; diff --git a/src/services/Cart.php b/src/services/Cart.php index fad1e1c..72149a7 100644 --- a/src/services/Cart.php +++ b/src/services/Cart.php @@ -19,7 +19,7 @@ class Cart extends Base * @param mixed $number * @return mixed */ - public function restore($number) + public function restore($number) // no return type as mixed is PHP 8 only { $commerceInstance = Commerce::getInstance(); diff --git a/src/services/Track.php b/src/services/Track.php index e46fe82..de6879d 100644 --- a/src/services/Track.php +++ b/src/services/Track.php @@ -85,7 +85,7 @@ private function isInGroup($selectedGroups, $userGroups): bool * @param mixed $context Default: null * @return mixed */ - protected function createProfile($params, $eventName = null, $context = null): mixed + protected function createProfile($params, $eventName = null, $context = null) // no return type as mixed is PHP 8 only { $profile = new Profile($params); @@ -345,7 +345,7 @@ public function trackOrder($eventName, $order, $profile = null, $timestamp = nul * @param string $event Default: '' * @return mixed */ - protected function getOrderDetails($order, $event = ''): mixed + protected function getOrderDetails($order, $event = '') // no return type as mixed is PHP 8 only { $settings = Plugin::getInstance()->settings; diff --git a/src/variables/Variable.php b/src/variables/Variable.php index 39795d2..b0846e5 100644 --- a/src/variables/Variable.php +++ b/src/variables/Variable.php @@ -18,7 +18,7 @@ class Variable * @access public * @return mixed */ - public function lists() + public function lists() // no return type as mixed is PHP 8 only { if (is_null($this->lists)) { try { @@ -43,7 +43,7 @@ public function lists() * @access public * @return mixed */ - public function error() + public function error() // no return type as mixed is PHP 8 only { return $this->error; }