From a868e87ba722f3ddf61c01648a1f2d36108e01f0 Mon Sep 17 00:00:00 2001 From: Marc Michalsky Date: Thu, 3 Aug 2023 15:05:34 +0200 Subject: [PATCH] minor changes --- CRM/Twingle/Profile.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php index b1beb49..0f9115e 100644 --- a/CRM/Twingle/Profile.php +++ b/CRM/Twingle/Profile.php @@ -52,14 +52,12 @@ class CRM_Twingle_Profile { /** * Logs (production) access to this profile - * - * @return bool */ public function logAccess() { CRM_Core_DAO::executeQuery(" - UPDATE civicrm_twingle_profile - SET - last_access = NOW(), + UPDATE civicrm_twingle_profile + SET + last_access = NOW(), access_counter = access_counter + 1 WHERE name = %1", [1 => [$this->name, 'String']]); } @@ -90,7 +88,7 @@ class CRM_Twingle_Profile { $custom_field_mapping = []; if (!empty($custom_field_definition = $this->getAttribute('custom_field_mapping'))) { foreach (preg_split('/\r\n|\r|\n/', $custom_field_definition, -1, PREG_SPLIT_NO_EMPTY) as $custom_field_map) { - list($twingle_field_name, $custom_field_name) = explode("=", $custom_field_map); + [$twingle_field_name, $custom_field_name] = explode("=", $custom_field_map); $custom_field_mapping[$twingle_field_name] = $custom_field_name; } } @@ -133,12 +131,7 @@ class CRM_Twingle_Profile { * @return mixed | NULL */ public function getAttribute($attribute_name, $default = NULL) { - if (isset($this->data[$attribute_name])) { - return $this->data[$attribute_name]; - } - else { - return $default; - } + return $this->data[$attribute_name] ?? $default; } /**