From: colemanw Date: Fri, 13 Oct 2023 23:42:49 +0000 (-0400) Subject: CRM/Campaign - Refactor unnecessary uses of CRM_Utils_Array::value X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ecb92f642aba67795812e99c64bc10282cbc9acd;p=civicrm-core.git CRM/Campaign - Refactor unnecessary uses of CRM_Utils_Array::value --- diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index c6aa2dc2cb..f0220a12b2 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -674,7 +674,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a ); $menuLinks[] = sprintf('%s', $urlPath, - CRM_Utils_Array::value('title', $link), + $link['title'] ?? NULL, $link['title'] ); } diff --git a/CRM/Campaign/Form/Campaign.php b/CRM/Campaign/Form/Campaign.php index 7feef215f2..f5a1c523bb 100644 --- a/CRM/Campaign/Form/Campaign.php +++ b/CRM/Campaign/Form/Campaign.php @@ -291,7 +291,7 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { $params['created_date'] = date('YmdHis'); } // format params - $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); + $params['is_active'] = $params['is_active'] ?? FALSE; $params['last_modified_id'] = $session->get('userID'); $params['last_modified_date'] = date('YmdHis'); $result = self::submit($params, $this); diff --git a/CRM/Campaign/Form/Petition.php b/CRM/Campaign/Form/Petition.php index 1cbd72d69b..55a7377984 100644 --- a/CRM/Campaign/Form/Petition.php +++ b/CRM/Campaign/Form/Petition.php @@ -291,7 +291,7 @@ WHERE $whereClause $params['last_modified_id'] = $session->get('userID'); $params['last_modified_date'] = date('YmdHis'); - $params['is_share'] = CRM_Utils_Array::value('is_share', $params, FALSE); + $params['is_share'] = $params['is_share'] ?? FALSE; if ($this->_surveyId) { @@ -309,9 +309,9 @@ WHERE $whereClause $params['created_date'] = date('YmdHis'); } - $params['bypass_confirm'] = CRM_Utils_Array::value('bypass_confirm', $params, 0); - $params['is_active'] = CRM_Utils_Array::value('is_active', $params, 0); - $params['is_default'] = CRM_Utils_Array::value('is_default', $params, 0); + $params['bypass_confirm'] = $params['bypass_confirm'] ?? 0; + $params['is_active'] = $params['is_active'] ?? 0; + $params['is_default'] = $params['is_default'] ?? 0; $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->getEntityId(), $this->getDefaultEntity()); diff --git a/CRM/Campaign/Form/Survey/Main.php b/CRM/Campaign/Form/Survey/Main.php index 2aca9a250b..e23617951b 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -155,8 +155,8 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { $params['created_date'] = date('YmdHis'); } - $params['is_active'] = CRM_Utils_Array::value('is_active', $params, 0); - $params['is_default'] = CRM_Utils_Array::value('is_default', $params, 0); + $params['is_active'] = $params['is_active'] ?? 0; + $params['is_default'] = $params['is_default'] ?? 0; $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->getEntityId(), $this->getDefaultEntity()); diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index 6236287a30..69e15a5585 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -254,9 +254,9 @@ class CRM_Campaign_Page_AJAX { TRUE, FALSE, FALSE, FALSE, FALSE, - CRM_Utils_Array::value('whereClause', $voterClause), + $voterClause['whereClause'] ?? NULL, NULL, - CRM_Utils_Array::value('fromClause', $voterClause) + $voterClause['fromClause'] ?? NULL ); $iTotal = $searchCount; @@ -287,9 +287,9 @@ class CRM_Campaign_Page_AJAX { FALSE, FALSE, FALSE, FALSE, FALSE, - CRM_Utils_Array::value('whereClause', $voterClause), + $voterClause['whereClause'] ?? NULL, $sortOrder, - CRM_Utils_Array::value('fromClause', $voterClause) + $voterClause['fromClause'] ?? NULL ); while ($result->fetch()) { $contactID = $result->contact_id;