Replace CRM_Utils_Array::value with ?? in variable assignments
[civicrm-core.git] / CRM / Contribute / Form / Contribution / ThankYou.php
index 65d4fb1fa9577e5dbf958dad75ea868c7b4a7237..41d8077543aea03efa981a353d76f6bddf282c1f 100644 (file)
@@ -204,7 +204,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $this->buildCustom($this->_values['onbehalf_profile_id'], 'onbehalfProfile', TRUE, 'onbehalf', $fieldTypes);
     }
 
-    $this->_trxnId = CRM_Utils_Array::value('trxn_id', $this->_params);
+    $this->_trxnId = $this->_params['trxn_id'] ?? NULL;
 
     $this->assign('trxn_id', $this->_trxnId);
 
@@ -283,10 +283,10 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
     try {
       // A payment notification update could have come in at any time. Check at the last minute.
       $contributionStatusID = civicrm_api3('Contribution', 'getvalue', [
-        'id' => CRM_Utils_Array::value('contributionID', $params),
+        'id' => $params['contributionID'] ?? NULL,
         'return' => 'contribution_status_id',
         'is_test'   => ($this->_mode == 'test') ? 1 : 0,
-        'invoice_id' => CRM_Utils_Array::value('invoiceID', $params),
+        'invoice_id' => $params['invoiceID'] ?? NULL,
       ]);
       if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID) === 'Pending'
         && !empty($params['payment_processor_id'])