From 7b6485a149216003b4027578d5242707b405aadf Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 4 May 2020 10:26:50 +1200 Subject: [PATCH] [REF] Minor code cleanup Do not pass params as reference as unchanged --- CRM/Contribute/BAO/ContributionPage.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index e07d891cb22e..f149957fe6f9 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -132,6 +132,8 @@ public static function setValues($id, &$values) { * Return the message text instead of sending the mail. * * @param array $fieldTypes + * + * @throws \CRM_Core_Exception */ public static function sendMail($contactID, $values, $isTest = FALSE, $returnMessageText = FALSE, $fieldTypes = NULL) { $gIds = []; @@ -472,8 +474,10 @@ public static function sendMail($contactID, $values, $isTest = FALSE, $returnMes * @param array $fieldTypes * * @return array + * + * @throws \CRM_Core_Exception */ - protected static function getProfileNameAndFields($gid, $cid, &$params, $fieldTypes = []) { + protected static function getProfileNameAndFields($gid, $cid, $params, $fieldTypes = []) { $groupTitle = NULL; $values = []; if ($gid) { @@ -481,14 +485,11 @@ protected static function getProfileNameAndFields($gid, $cid, &$params, $fieldTy $fields = CRM_Core_BAO_UFGroup::getFields($gid, FALSE, CRM_Core_Action::VIEW, NULL, NULL, FALSE, NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL); foreach ($fields as $k => $v) { if (!$groupTitle) { - $groupTitle = $v["groupTitle"]; + $groupTitle = $v['groupTitle']; } // suppress all file fields from display and formatting fields if ( - CRM_Utils_Array::value('data_type', $v, '') == 'File' || - CRM_Utils_Array::value('name', $v, '') == 'image_URL' || - CRM_Utils_Array::value('field_type', $v) == 'Formatting' - ) { + $v['data_type'] === 'File' || $v['name'] === 'image_URL' || $v['field_type'] === 'Formatting') { unset($fields[$k]); }