Skip to content

Commit

Permalink
Merge branch 'develop-craft3' of github.com:FosterCommerce/klaviyocon…
Browse files Browse the repository at this point in the history
…nect into develop-craft3
  • Loading branch information
peteeveleigh committed Jun 30, 2022
2 parents 0c96411 + ce7452f commit 6baa69d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# 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
- Added a controller method for updating a Klaviyo profile

## 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.

Expand Down
6 changes: 3 additions & 3 deletions src/controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/fields/ListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/fields/ListsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/models/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/services/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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.');
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/services/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/services/Track.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/variables/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}
Expand Down

0 comments on commit 6baa69d

Please sign in to comment.