diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 971f433f913e..8ad64dabdca1 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -199,7 +199,7 @@ public static function add(&$params) { CRM_Contribute_BAO_ContributionRecur::updateOnNewPayment( (!empty($params['contribution_recur_id']) ? $params['contribution_recur_id'] : $params['prevContribution']->contribution_recur_id), $contributionStatus, - CRM_Utils_Array::value('receive_date', $params) + $params['receive_date'] ?? NULL ); } @@ -2262,7 +2262,7 @@ public static function transitionComponents($params, $processContributionObject $numterms = 1; $lineitems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contributionId); foreach ($lineitems as $lineitem) { - if ($membership->membership_type_id == CRM_Utils_Array::value('membership_type_id', $lineitem)) { + if ($membership->membership_type_id == ($lineitem['membership_type_id'] ?? NULL)) { $numterms = $lineitem['membership_num_terms'] ?? NULL; // in case membership_num_terms comes through as null or zero @@ -2324,7 +2324,7 @@ public static function transitionComponents($params, $processContributionObject //updating the membership log $membershipLog = []; $membershipLog = $formattedParams; - $logStartDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('log_start_date', $dates), $format); + $logStartDate = CRM_Utils_Date::customFormat($dates['log_start_date'] ?? NULL, $format); $logStartDate = ($logStartDate) ? CRM_Utils_Date::isoToMysql($logStartDate) : $formattedParams['start_date']; $membershipLog['start_date'] = $logStartDate; @@ -3237,7 +3237,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa // For some unit tests contribution cannot contain paymentProcessor information $billingMode = empty($this->_relatedObjects['paymentProcessor']) ? CRM_Core_Payment::BILLING_MODE_NOTIFY : $this->_relatedObjects['paymentProcessor']['billing_mode']; - $template->assign('contributeMode', CRM_Utils_Array::value($billingMode, CRM_Core_SelectValues::contributeMode())); + $template->assign('contributeMode', CRM_Core_SelectValues::contributeMode()[$billingMode] ?? NULL); //assign honor information to receipt message $softRecord = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id); @@ -3287,7 +3287,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa $template->assign('price', $productDAO->price); $template->assign('sku', $productDAO->sku); } - $template->assign('title', CRM_Utils_Array::value('title', $values)); + $template->assign('title', $values['title'] ?? NULL); $values['amount'] = CRM_Utils_Array::value('total_amount', $input, (CRM_Utils_Array::value('amount', $input)), NULL); if (!$values['amount'] && isset($this->total_amount)) { $values['amount'] = $this->total_amount; @@ -3333,11 +3333,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa ); $values['receipt_date'] = (empty($this->receipt_date) ? NULL : $this->receipt_date); $template->assign('action', $this->is_test ? 1024 : 1); - $template->assign('receipt_text', - CRM_Utils_Array::value('receipt_text', - $values - ) - ); + $template->assign('receipt_text', $values['receipt_text'] ?? NULL); $template->assign('is_monetary', 1); $template->assign('is_recur', !empty($this->contribution_recur_id)); $template->assign('currency', $this->currency);