Use ?? operator instead of CRM_Utils_Array::value() in array assignments
authorColeman Watts <coleman@civicrm.org>
Sun, 8 Mar 2020 19:35:34 +0000 (15:35 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 11 Mar 2020 23:47:02 +0000 (19:47 -0400)
80 files changed:
CRM/Activity/BAO/Activity.php
CRM/Activity/BAO/ActivityType.php
CRM/Admin/Form/ParticipantStatusType.php
CRM/Admin/Page/MessageTemplates.php
CRM/Batch/Form/Entry.php
CRM/Campaign/Form/Task/Reserve.php
CRM/Case/BAO/Case.php
CRM/Case/Form/Activity/ChangeCaseStatus.php
CRM/Case/Form/Activity/ChangeCaseType.php
CRM/Case/Form/Activity/OpenCase.php
CRM/Case/Form/CaseView.php
CRM/Case/XMLProcessor/Process.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Group.php
CRM/Contact/Form/Contact.php
CRM/Contact/Import/Parser.php
CRM/Contact/Selector.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/Form/AdditionalInfo.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/ThankYou.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Form/Task/PDFLetterCommon.php
CRM/Contribute/Import/Parser/Contribution.php
CRM/Core/BAO/Block.php
CRM/Core/BAO/CustomGroup.php
CRM/Core/BAO/CustomValueTable.php
CRM/Core/BAO/Dashboard.php
CRM/Core/BAO/FinancialTrxn.php
CRM/Core/BAO/Tag.php
CRM/Core/BAO/UFGroup.php
CRM/Core/Menu.php
CRM/Core/Payment/PayPalImpl.php
CRM/Core/PseudoConstant.php
CRM/Custom/Import/Parser/Api.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/Participant.php
CRM/Event/Cart/BAO/MerParticipant.php
CRM/Event/Cart/Form/Checkout/Payment.php
CRM/Event/Form/Participant.php
CRM/Event/Form/Registration.php
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/SelfSvcTransfer.php
CRM/Event/Page/EventInfo.php
CRM/Financial/BAO/Payment.php
CRM/Financial/Form/PaymentEdit.php
CRM/Friend/BAO/Friend.php
CRM/Logging/Differ.php
CRM/Member/BAO/Membership.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipRenewal.php
CRM/Member/Form/MembershipView.php
CRM/Pledge/BAO/Pledge.php
CRM/Pledge/BAO/PledgeBlock.php
CRM/Price/BAO/LineItem.php
CRM/Price/BAO/PriceField.php
CRM/Report/Form.php
CRM/Report/Form/Case/Detail.php
CRM/Utils/Address.php
CRM/Utils/Check/Component/Env.php
CRM/Utils/Date.php
CRM/Utils/DeprecatedUtils.php
CRM/Utils/Pager.php
CRM/Utils/Recent.php
CRM/Utils/Sort.php
api/v3/Activity.php
api/v3/Case.php
api/v3/Contact.php
api/v3/Domain.php
api/v3/Profile.php
api/v3/System.php
ext/sequentialcreditnotes/sequentialcreditnotes.civix.php
tests/phpunit/CRM/Contact/BAO/ContactTest.php
tests/phpunit/CRM/Core/BAO/LocationTest.php
tools/extensions/org.civicrm.angularex/angularex.civix.php

index 3687df1b17337bf0c00a0b877862801f95226fa9..de4479355025b56bf3cb4e9fcc5731d213a51f60 100644 (file)
@@ -749,11 +749,11 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
     foreach ($result as $id => $activity) {
       $activities[$id] = [
         'activity_id' => $activity['id'],
-        'activity_date_time' => CRM_Utils_Array::value('activity_date_time', $activity),
-        'subject' => CRM_Utils_Array::value('subject', $activity),
+        'activity_date_time' => $activity['activity_date_time'] ?? NULL,
+        'subject' => $activity['subject'] ?? NULL,
         'assignee_contact_name' => CRM_Utils_Array::value('assignee_contact_sort_name', $activity, []),
-        'source_contact_id' => CRM_Utils_Array::value('source_contact_id', $activity),
-        'source_contact_name' => CRM_Utils_Array::value('source_contact_sort_name', $activity),
+        'source_contact_id' => $activity['source_contact_id'] ?? NULL,
+        'source_contact_name' => $activity['source_contact_sort_name'] ?? NULL,
       ];
       $activities[$id]['activity_type_name'] = CRM_Core_PseudoConstant::getName('CRM_Activity_BAO_Activity', 'activity_type_id', $activity['activity_type_id']);
       $activities[$id]['activity_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $activity['activity_type_id']);
@@ -2458,8 +2458,8 @@ INNER JOIN  civicrm_option_group grp ON (grp.id = option_group_id AND grp.name =
       'is_deleted' => 0,
       'is_current_revision' => 1,
       'is_test' => 0,
-      'contact_id' => CRM_Utils_Array::value('contact_id', $params),
-      'activity_date_time' => CRM_Utils_Array::value('activity_date_time', $params),
+      'contact_id' => $params['contact_id'] ?? NULL,
+      'activity_date_time' => $params['activity_date_time'] ?? NULL,
       'check_permissions' => 1,
       'options' => [
         'offset' => CRM_Utils_Array::value('offset', $params, 0),
index c971500511d992f63d9c3d7a5f281feee10cc4d0..3a27f8275afa0437c91907e5a37cd3d327ab7901 100644 (file)
@@ -74,8 +74,8 @@ class CRM_Activity_BAO_ActivityType {
       $displayLabels = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $activity_type_id, 'label');
 
       $this->_activityType = [
-        'machineName' => CRM_Utils_Array::value($activity_type_id, $machineNames),
-        'displayLabel' => CRM_Utils_Array::value($activity_type_id, $displayLabels),
+        'machineName' => $machineNames[$activity_type_id] ?? NULL,
+        'displayLabel' => $displayLabels[$activity_type_id] ?? NULL,
         'id' => $activity_type_id,
       ];
     }
index c193d251d8c1dbfda08f2fee579aa4667c06b11c..168aa180c586a5650b937eac9454c2a6f92ed518 100644 (file)
@@ -86,13 +86,13 @@ class CRM_Admin_Form_ParticipantStatusType extends CRM_Admin_Form {
     $formValues = $this->controller->exportValues($this->_name);
 
     $params = [
-      'name' => CRM_Utils_Array::value('name', $formValues),
-      'label' => CRM_Utils_Array::value('label', $formValues),
-      'class' => CRM_Utils_Array::value('class', $formValues),
+      'name' => $formValues['name'] ?? NULL,
+      'label' => $formValues['label'] ?? NULL,
+      'class' => $formValues['class'] ?? NULL,
       'is_active' => CRM_Utils_Array::value('is_active', $formValues, FALSE),
       'is_counted' => CRM_Utils_Array::value('is_counted', $formValues, FALSE),
-      'weight' => CRM_Utils_Array::value('weight', $formValues),
-      'visibility_id' => CRM_Utils_Array::value('visibility_id', $formValues),
+      'weight' => $formValues['weight'] ?? NULL,
+      'visibility_id' => $formValues['visibility_id'] ?? NULL,
     ];
 
     // make sure a malicious POST does not change these on reserved statuses
index 03b2a1ed479d9f6e8d8355bc4e38694b4dae71c4..4eb05bb68713afd3f0fcdf046d6f1523d6eb349d 100644 (file)
@@ -154,7 +154,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
       $values['action'] = CRM_Core_Action::formLink($links, $action,
         [
           'id' => $object->id,
-          'orig_id' => CRM_Utils_Array::value($object->id, $this->_revertible),
+          'orig_id' => $this->_revertible[$object->id] ?? NULL,
         ],
         ts('more'),
         FALSE,
index 96d10fd4d66a0efbf792583d276954ac0231306b..a62c649b32540978cef2a30800cfd11efc5061e0 100644 (file)
@@ -789,8 +789,8 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
           }
 
           $formDates = [
-            'end_date' => CRM_Utils_Array::value('membership_end_date', $value),
-            'start_date' => CRM_Utils_Array::value('membership_start_date', $value),
+            'end_date' => $value['membership_end_date'] ?? NULL,
+            'start_date' => $value['membership_start_date'] ?? NULL,
           ];
           $membershipSource = CRM_Utils_Array::value('source', $value);
           list($membership) = CRM_Member_BAO_Membership::processMembership(
index b6a39ddb78e67dd9178420f8d734df912a8e81d7..aebc1692c43421381b451bdeec2ce8cd2c2f09df 100644 (file)
@@ -237,7 +237,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task {
         'activity_date_time' => date('YmdHis'),
         'status_id' => $statusHeld,
         'skipRecentView' => 1,
-        'campaign_id' => CRM_Utils_Array::value('campaign_id', $this->_surveyDetails),
+        'campaign_id' => $this->_surveyDetails['campaign_id'] ?? NULL,
       ];
       $activity = CRM_Activity_BAO_Activity::create($activityParams);
       if ($activity->id) {
index bda424a9eff909f6ac02524f7445be2e5ec851be..1af50d3a03872011cc176eec2de501f0704d715e 100644 (file)
@@ -1306,7 +1306,7 @@ HERESQL;
         [
           'groupName' => 'msg_tpl_workflow_case',
           'valueName' => 'case_activity',
-          'contactId' => CRM_Utils_Array::value('contact_id', $info),
+          'contactId' => $info['contact_id'] ?? NULL,
           'tplParams' => $tplParams,
           'from' => $receiptFrom,
           'toName' => $displayName,
index 56ad8f362abb942ff32b85b2ff9e7e1512be52ab..9c985a2257dddc271f4509ab30f0adb25cfbc6b9 100644 (file)
@@ -194,8 +194,8 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
     foreach ($form->_oldCaseStatus as $statuskey => $statusval) {
       if ($activity->subject == 'null') {
         $activity->subject = ts('Case status changed from %1 to %2', [
-          1 => CRM_Utils_Array::value($statusval, $form->_caseStatus),
-          2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus),
+          1 => $form->_caseStatus[$statusval] ?? NULL,
+          2 => $form->_caseStatus[$params['case_status_id']] ?? NULL,
         ]);
         $activity->save();
       }
index fe6ba63475fb20273bf59b5801de0016c65769b8..bf85169449e81548613aaa849b57c86e64de5bd4 100644 (file)
@@ -145,8 +145,8 @@ class CRM_Case_Form_Activity_ChangeCaseType {
     if ($activity->subject == 'null') {
       $activity->subject = ts('Case type changed from %1 to %2',
         [
-          1 => CRM_Utils_Array::value($form->_defaults['case_type_id'], $allCaseTypes),
-          2 => CRM_Utils_Array::value($params['case_type_id'], $allCaseTypes),
+          1 => $allCaseTypes[$form->_defaults['case_type_id']] ?? NULL,
+          2 => $allCaseTypes[$params['case_type_id']] ?? NULL,
         ]
       );
       $activity->save();
@@ -160,9 +160,9 @@ class CRM_Case_Form_Activity_ChangeCaseType {
       'creatorID' => $form->_currentUserId,
       'standardTimeline' => 1,
       'activityTypeName' => 'Change Case Type',
-      'activity_date_time' => CRM_Utils_Array::value('reset_date_time', $params),
+      'activity_date_time' => $params['reset_date_time'] ?? NULL,
       'caseID' => $caseId,
-      'resetTimeline' => CRM_Utils_Array::value('is_reset_timeline', $params),
+      'resetTimeline' => $params['is_reset_timeline'] ?? NULL,
     ];
 
     $xmlProcessor->run($caseType, $xmlProcessorParams);
index 36157a3aaa359173eff92527fc3b93bda54b169b..ae9405cc1e3295d57308b4bc0e90abe6d705f1db 100644 (file)
@@ -303,10 +303,10 @@ class CRM_Case_Form_Activity_OpenCase {
       'subject' => $params['activity_subject'],
       'location' => $params['location'],
       'activity_date_time' => $params['start_date'],
-      'duration' => CRM_Utils_Array::value('duration', $params),
+      'duration' => $params['duration'] ?? NULL,
       'medium_id' => $params['medium_id'],
       'details' => $params['activity_details'],
-      'relationship_end_date' => CRM_Utils_Array::value('end_date', $params),
+      'relationship_end_date' => $params['end_date'] ?? NULL,
     ];
 
     if (array_key_exists('custom', $params) && is_array($params['custom'])) {
index d3dae3609d75095045f53063672b07de33caa540..89283b99131de4fcaf3e50b14de27a00ded1b7f5 100644 (file)
@@ -81,8 +81,8 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
 
     $this->_caseDetails = [
       'case_type' => $caseType,
-      'case_status' => CRM_Utils_Array::value($values['case_status_id'], $statuses),
-      'case_subject' => CRM_Utils_Array::value('subject', $values),
+      'case_status' => $statuses[$values['case_status_id']] ?? NULL,
+      'case_subject' => $values['subject'] ?? NULL,
       'case_start_date' => $values['case_start_date'],
     ];
     $this->_caseType = $caseTypeName;
index ddb717b0370a2b7a5357cfe70d36ac480e5fb852..066f01f02691e143cef11e0793fabcd92170c66b 100644 (file)
@@ -219,7 +219,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor {
         'is_active' => 1,
         'case_id' => $params['caseID'],
         'start_date' => date("Ymd"),
-        'end_date' => CRM_Utils_Array::value('relationship_end_date', $params),
+        'end_date' => $params['relationship_end_date'] ?? NULL,
       ];
 
       if (substr($relationshipType, -4) == '_b_a') {
@@ -451,10 +451,10 @@ AND        a.is_deleted = 0
         'subject' => !empty($params['subject']) ? $params['subject'] : $activityTypeName,
         'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', $statusName),
         'target_contact_id' => $client,
-        'medium_id' => CRM_Utils_Array::value('medium_id', $params),
-        'location' => CRM_Utils_Array::value('location', $params),
-        'details' => CRM_Utils_Array::value('details', $params),
-        'duration' => CRM_Utils_Array::value('duration', $params),
+        'medium_id' => $params['medium_id'] ?? NULL,
+        'location' => $params['location'] ?? NULL,
+        'details' => $params['details'] ?? NULL,
+        'duration' => $params['duration'] ?? NULL,
         'weight' => $orderVal,
       ];
     }
index f068d0a0337caff9e5285ac2ba394c771aca6248..6bbd3f85211c36d147d7d926db2e4dd40cde0932 100644 (file)
@@ -360,7 +360,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
             'entity_id' => $contact->id,
             'entity_table' => 'civicrm_contact',
             'note' => $note['note'],
-            'subject' => CRM_Utils_Array::value('subject', $note),
+            'subject' => $note['subject'] ?? NULL,
             'contact_id' => $contactId,
           ];
           CRM_Core_BAO_Note::add($noteParams);
@@ -377,7 +377,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
           'entity_id' => $contact->id,
           'entity_table' => 'civicrm_contact',
           'note' => $params['note'],
-          'subject' => CRM_Utils_Array::value('subject', $params),
+          'subject' => $params['subject'] ?? NULL,
           'contact_id' => $contactId,
         ];
         CRM_Core_BAO_Note::add($noteParams);
@@ -754,7 +754,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
     //lookup value of email/postal greeting, addressee, CRM-4575
     foreach (self::$_greetingTypes as $greeting) {
       $filterCondition = [
-        'contact_type' => CRM_Utils_Array::value('contact_type', $defaults),
+        'contact_type' => $defaults['contact_type'] ?? NULL,
         'greeting_type' => $greeting,
       ];
       CRM_Utils_Array::lookupValue($defaults, $greeting,
@@ -3195,7 +3195,7 @@ AND       civicrm_openid.is_primary = 1";
           $contextMenu['primaryActions'][$key] = [
             'title' => $values['title'],
             'ref' => $values['ref'],
-            'class' => CRM_Utils_Array::value('class', $values),
+            'class' => $values['class'] ?? NULL,
             'key' => $values['key'],
           ];
           continue;
@@ -3205,9 +3205,9 @@ AND       civicrm_openid.is_primary = 1";
         $contextMenu['moreActions'][$values['weight']] = [
           'title' => $values['title'],
           'ref' => $values['ref'],
-          'href' => CRM_Utils_Array::value('href', $values),
-          'tab' => CRM_Utils_Array::value('tab', $values),
-          'class' => CRM_Utils_Array::value('class', $values),
+          'href' => $values['href'] ?? NULL,
+          'tab' => $values['tab'] ?? NULL,
+          'class' => $values['class'] ?? NULL,
           'key' => $values['key'],
         ];
       }
@@ -3222,10 +3222,10 @@ AND       civicrm_openid.is_primary = 1";
           $contextMenu['otherActions'][$value['weight']] = [
             'title' => $value['title'],
             'ref' => $value['ref'],
-            'href' => CRM_Utils_Array::value('href', $value),
-            'tab' => CRM_Utils_Array::value('tab', $value),
-            'class' => CRM_Utils_Array::value('class', $value),
-            'icon' => CRM_Utils_Array::value('icon', $value),
+            'href' => $value['href'] ?? NULL,
+            'tab' => $value['tab'] ?? NULL,
+            'class' => $value['class'] ?? NULL,
+            'icon' => $value['icon'] ?? NULL,
             'key' => $value['key'],
           ];
         }
index 57692ca8df16fbf590ad3ac1078db5ec4efa90f5..0dd64ed62eebc6323f45c6025ec569a50313d889 100644 (file)
@@ -695,8 +695,8 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
         'title' => "Hidden Smart Group {$ssId}",
         'is_active' => CRM_Utils_Array::value('is_active', $params, 1),
         'is_hidden' => CRM_Utils_Array::value('is_hidden', $params, 1),
-        'group_type' => CRM_Utils_Array::value('group_type', $params),
-        'visibility' => CRM_Utils_Array::value('visibility', $params),
+        'group_type' => $params['group_type'] ?? NULL,
+        'visibility' => $params['visibility'] ?? NULL,
         'saved_search_id' => $ssId,
       ];
 
index 314f3ea878e46650cb88823b6c19d433961a308b..a36de18d6752572c7752da35d1bb6160b9ad667b 100644 (file)
@@ -910,7 +910,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
     if (isset($params['contact_id'])) {
       // process membership status for deceased contact
       $deceasedParams = [
-        'contact_id' => CRM_Utils_Array::value('contact_id', $params),
+        'contact_id' => $params['contact_id'] ?? NULL,
         'is_deceased' => CRM_Utils_Array::value('is_deceased', $params, FALSE),
         'deceased_date' => CRM_Utils_Array::value('deceased_date', $params, NULL),
       ];
index a4b11fb439e09d39dadbbc37acebd346c2b7b4ab..d3791a59732a5bd40c624e2e6a1e23c958199922 100644 (file)
@@ -1026,7 +1026,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
     if (isset($values['email_greeting'])) {
       if (!empty($params['email_greeting_id'])) {
         $emailGreetingFilter = [
-          'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+          'contact_type' => $params['contact_type'] ?? NULL,
           'greeting_type' => 'email_greeting',
         ];
         $emailGreetings = CRM_Core_PseudoConstant::greeting($emailGreetingFilter);
@@ -1042,7 +1042,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
     if (isset($values['postal_greeting'])) {
       if (!empty($params['postal_greeting_id'])) {
         $postalGreetingFilter = [
-          'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+          'contact_type' => $params['contact_type'] ?? NULL,
           'greeting_type' => 'postal_greeting',
         ];
         $postalGreetings = CRM_Core_PseudoConstant::greeting($postalGreetingFilter);
@@ -1057,7 +1057,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
     if (isset($values['addressee'])) {
       if (!empty($params['addressee_id'])) {
         $addresseeFilter = [
-          'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+          'contact_type' => $params['contact_type'] ?? NULL,
           'greeting_type' => 'addressee',
         ];
         $addressee = CRM_Core_PseudoConstant::addressee($addresseeFilter);
index f9ddd8e9549d4e0681e33da5aa25fceb9cbe10d8..c0faf5b46331337edd8a21cb10f0a4b3e8ec0b26 100644 (file)
@@ -308,7 +308,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
             'qs' => $qs,
             'title' => $value['title'],
             'ref' => $value['ref'],
-            'class' => CRM_Utils_Array::value('class', $value),
+            'class' => $value['class'] ?? NULL,
           ];
         }
       }
index dc2e3eb8717e1fc4529632a02c8be80724ece1c4..6a39286c5130d4f7684d637125ddc1f12b87a4b6 100644 (file)
@@ -1235,7 +1235,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
         'contact_id' => $params['prevContribution']->contact_id,
         'currency' => $currency,
         'amount' => self::getFinancialItemAmountFromParams($inputParams, $context, $lineItemDetails, $isARefund, $previousLineItemTotal),
-        'description' => CRM_Utils_Array::value('description', $prevFinancialItem),
+        'description' => $prevFinancialItem['description'] ?? NULL,
         'status_id' => $prevFinancialItem['status_id'],
         'financial_account_id' => $financialAccount,
         'entity_table' => 'civicrm_line_item',
@@ -3645,7 +3645,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
         'to_financial_account_id' => $params['to_financial_account_id'],
         'trxn_date' => !empty($params['contribution']->receive_date) ? $params['contribution']->receive_date : date('YmdHis'),
         'total_amount' => $totalAmount,
-        'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
+        'fee_amount' => $params['fee_amount'] ?? NULL,
         'net_amount' => CRM_Utils_Array::value('net_amount', $params, $totalAmount),
         'currency' => $params['contribution']->currency,
         'trxn_id' => $params['contribution']->trxn_id,
@@ -3654,9 +3654,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
         // this should really default to completed (after discussion).
         'status_id' => $statusId,
         'payment_instrument_id' => CRM_Utils_Array::value('payment_instrument_id', $params, $params['contribution']->payment_instrument_id),
-        'check_number' => CRM_Utils_Array::value('check_number', $params),
-        'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
-        'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
+        'check_number' => $params['check_number'] ?? NULL,
+        'pan_truncation' => $params['pan_truncation'] ?? NULL,
+        'card_type_id' => $params['card_type_id'] ?? NULL,
       ];
       if ($contributionStatus == 'Refunded' || $contributionStatus == 'Chargeback' || $contributionStatus == 'Cancelled') {
         $trxnParams['trxn_date'] = !empty($params['contribution']->cancel_date) ? $params['contribution']->cancel_date : date('YmdHis');
index 3be25fe15ff00ef139ed08870f983760bff55018..7b3edc1076b3adcc423bd4a3b127cf1d22ad3170 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
 
     if ($isPaymentTransaction) {
       $contributionParams = [
-        'id' => CRM_Utils_Array::value('contribution_id', $paymentParams),
+        'id' => $paymentParams['contribution_id'] ?? NULL,
         'contact_id' => $contactID,
         'is_test' => $isTest,
         'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
index 43cbb90546181dd9e5ef90eb10b0f5394d3bf32e..8d575ad2d2e7ed1c895a185a02c972121ccca9fc 100644 (file)
@@ -346,18 +346,18 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
       // All of these will be assigned to the template, replacing any that might be assigned elsewhere.
       $tplParams = [
         'email' => $email,
-        'receiptFromEmail' => CRM_Utils_Array::value('receipt_from_email', $values),
+        'receiptFromEmail' => $values['receipt_from_email'] ?? NULL,
         'contactID' => $contactID,
         'displayName' => $displayName,
-        'contributionID' => CRM_Utils_Array::value('contribution_id', $values),
-        'contributionOtherID' => CRM_Utils_Array::value('contribution_other_id', $values),
+        'contributionID' => $values['contribution_id'] ?? NULL,
+        'contributionOtherID' => $values['contribution_other_id'] ?? NULL,
         // CRM-5095
-        'lineItem' => CRM_Utils_Array::value('lineItem', $values),
+        'lineItem' => $values['lineItem'] ?? NULL,
         // CRM-5095
-        'priceSetID' => CRM_Utils_Array::value('priceSetID', $values),
+        'priceSetID' => $values['priceSetID'] ?? NULL,
         'title' => $title,
-        'isShare' => CRM_Utils_Array::value('is_share', $values),
-        'thankyou_title' => CRM_Utils_Array::value('thankyou_title', $values),
+        'isShare' => $values['is_share'] ?? NULL,
+        'thankyou_title' => $values['thankyou_title'] ?? NULL,
         'customPre' => $values['customPre'],
         'customPre_grouptitle' => $values['customPre_grouptitle'],
         'customPost' => $values['customPost'],
@@ -367,9 +367,9 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         'amount' => $values['amount'],
         'is_pay_later' => $values['is_pay_later'],
         'receipt_date' => !$values['receipt_date'] ? NULL : date('YmdHis', strtotime($values['receipt_date'])),
-        'pay_later_receipt' => CRM_Utils_Array::value('pay_later_receipt', $values),
-        'honor_block_is_active' => CRM_Utils_Array::value('honor_block_is_active', $values),
-        'contributionStatus' => CRM_Utils_Array::value('contribution_status', $values),
+        'pay_later_receipt' => $values['pay_later_receipt'] ?? NULL,
+        'honor_block_is_active' => $values['honor_block_is_active'] ?? NULL,
+        'contributionStatus' => $values['contribution_status'] ?? NULL,
       ];
 
       if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) {
index 2b385a3414867af1b731d245e56735dad5ee1473..3a9a441c5d0433b7053f4f4584364b2afc6a98e1 100644 (file)
@@ -250,7 +250,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
     }
     $activityParams = [
       'subject' => !empty($params['membership_id']) ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'),
-      'details' => CRM_Utils_Array::value('processor_message', $params),
+      'details' => $params['processor_message'] ?? NULL,
     ];
 
     $cancelledId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_ContributionRecur', 'contribution_status_id', 'Cancelled');
index ad9f2b6ed1010e77e6f86294ad58fa1fc77eeea1..706a3508b49d9fe8c1650acfb56f578c4cc6042f 100644 (file)
@@ -207,9 +207,9 @@ class CRM_Contribute_Form_AdditionalInfo {
     //CRM-11106
     if ($premiumID == NULL || $isDeleted) {
       $premiumParams = [
-        'cost' => CRM_Utils_Array::value('cost', $productDetails),
-        'currency' => CRM_Utils_Array::value('currency', $productDetails),
-        'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $productDetails),
+        'cost' => $productDetails['cost'] ?? NULL,
+        'currency' => $productDetails['currency'] ?? NULL,
+        'financial_type_id' => $productDetails['financial_type_id'] ?? NULL,
         'contributionId' => $contributionID,
       ];
       if ($isDeleted) {
index a47c573dd15ea0b72cc073d22a316e301a14fbee..027c1690cb2d512445a0ff96b5362951ac7fe312 100644 (file)
@@ -1126,14 +1126,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       $this->set('is_deductible', TRUE);
     }
     $contributionParams = [
-      'id' => CRM_Utils_Array::value('contribution_id', $this->_params),
+      'id' => $this->_params['contribution_id'] ?? NULL,
       'contact_id' => $contactID,
       'line_item' => $lineItem,
       'is_test' => $isTest,
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $this->_params),
-      'contribution_page_id' => CRM_Utils_Array::value('contribution_page_id', $this->_params),
+      'campaign_id' => $this->_params['campaign_id'] ?? NULL,
+      'contribution_page_id' => $this->_params['contribution_page_id'] ?? NULL,
       'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
-      'thankyou_date' => CRM_Utils_Array::value('thankyou_date', $this->_params),
+      'thankyou_date' => $this->_params['thankyou_date'] ?? NULL,
     ];
     $contributionParams['payment_instrument_id'] = $this->_paymentProcessor['payment_instrument_id'];
 
@@ -1178,9 +1178,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
               'trxn_id' => $result['trxn_id'],
               'payment_processor_id' => $this->_paymentProcessor['id'],
               'is_transactional' => FALSE,
-              'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
-              'card_type_id' => CRM_Utils_Array::value('card_type_id', $paymentParams),
-              'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $paymentParams),
+              'fee_amount' => $result['fee_amount'] ?? NULL,
+              'card_type_id' => $paymentParams['card_type_id'] ?? NULL,
+              'pan_truncation' => $paymentParams['pan_truncation'] ?? NULL,
               'is_email_receipt' => FALSE,
             ]);
             // This has now been set to 1 in the DB - declare it here also
index 013e1b8b942ba48d64bb09ac1d48f490ac5d3168..1f3737da9c0e6945b591bb1ba88175794807379c 100644 (file)
@@ -156,8 +156,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
     $contributionParams = [
       'financial_type_id' => $financialTypeID,
       'receive_date' => (CRM_Utils_Array::value('receive_date', $params)) ? CRM_Utils_Date::processDate($params['receive_date']) : date('YmdHis'),
-      'tax_amount' => CRM_Utils_Array::value('tax_amount', $params),
-      'amount_level' => CRM_Utils_Array::value('amount_level', $params),
+      'tax_amount' => $params['tax_amount'] ?? NULL,
+      'amount_level' => $params['amount_level'] ?? NULL,
       'invoice_id' => $params['invoiceID'],
       'currency' => $params['currencyID'],
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
@@ -806,7 +806,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       $params = [
         'product_id' => $premiumParams['selectProduct'],
         'contribution_id' => $contribution->id,
-        'product_option' => CRM_Utils_Array::value('options_' . $premiumParams['selectProduct'], $premiumParams),
+        'product_option' => $premiumParams['options_' . $premiumParams['selectProduct']] ?? NULL,
         'quantity' => 1,
         'start_date' => CRM_Utils_Date::customFormat($startDate, '%Y%m%d'),
         'end_date' => CRM_Utils_Date::customFormat($endDate, '%Y%m%d'),
@@ -2478,13 +2478,13 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       try {
         civicrm_api3('contribution', 'completetransaction', [
           'id' => $contributionID,
-          'trxn_id' => CRM_Utils_Array::value('trxn_id', $result),
+          'trxn_id' => $result['trxn_id'] ?? NULL,
           'payment_processor_id' => CRM_Utils_Array::value('payment_processor_id', $result, $this->_paymentProcessor['id']),
           'is_transactional' => FALSE,
-          'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
-          'receive_date' => CRM_Utils_Array::value('receive_date', $result),
-          'card_type_id' => CRM_Utils_Array::value('card_type_id', $result),
-          'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $result),
+          'fee_amount' => $result['fee_amount'] ?? NULL,
+          'receive_date' => $result['receive_date'] ?? NULL,
+          'card_type_id' => $result['card_type_id'] ?? NULL,
+          'pan_truncation' => $result['pan_truncation'] ?? NULL,
         ]);
       }
       catch (CiviCRM_API3_Exception $e) {
index 65d4fb1fa9577e5dbf958dad75ea868c7b4a7237..deb0d26bcee10f0ef9d486b299c4b95df24416dd 100644 (file)
@@ -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'])
index 499af139b7040344c4ffd86c5aa23ee65e2fc909..7963d33548467bc4377a9e0d976352a442c3fd3f 100644 (file)
@@ -685,7 +685,7 @@ class CRM_Contribute_Form_ContributionPage_Amount extends CRM_Contribute_Form_Co
                   'label' => ts('Other Amount'),
                   'price_set_id' => $priceSetId,
                   'html_type' => 'Text',
-                  'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $this->_values),
+                  'financial_type_id' => $this->_values['financial_type_id'] ?? NULL,
                   'is_display_amounts' => 0,
                   'weight' => 3,
                 ];
index d01811b9cd006bf3589bfb06d52d844b7b407783..f2a0298655ffa3095efef268e0804a224b9fdf34 100644 (file)
@@ -364,7 +364,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
         'amountPaid' => $amountPaid,
         'invoice_date' => $invoiceDate,
         'dueDate' => $dueDate,
-        'notes' => CRM_Utils_Array::value('notes', $prefixValue),
+        'notes' => $prefixValue['notes'] ?? NULL,
         'display_name' => $contribution->_relatedObjects['contact']->display_name,
         'lineItem' => $lineItem,
         'dataArray' => $dataArray,
@@ -374,17 +374,17 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
         'contribution_status_id' => $contribution->contribution_status_id,
         'contributionStatusName' => CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contribution->contribution_status_id),
         'subTotal' => $subTotal,
-        'street_address' => CRM_Utils_Array::value('street_address', $billingAddress),
-        'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', $billingAddress),
-        'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', $billingAddress),
-        'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3', $billingAddress),
-        'city' => CRM_Utils_Array::value('city', $billingAddress),
-        'postal_code' => CRM_Utils_Array::value('postal_code', $billingAddress),
-        'state_province' => CRM_Utils_Array::value('state_province', $billingAddress),
-        'state_province_abbreviation' => CRM_Utils_Array::value('state_province_abbreviation', $billingAddress),
+        'street_address' => $billingAddress['street_address'] ?? NULL,
+        'supplemental_address_1' => $billingAddress['supplemental_address_1'] ?? NULL,
+        'supplemental_address_2' => $billingAddress['supplemental_address_2'] ?? NULL,
+        'supplemental_address_3' => $billingAddress['supplemental_address_3'] ?? NULL,
+        'city' => $billingAddress['city'] ?? NULL,
+        'postal_code' => $billingAddress['postal_code'] ?? NULL,
+        'state_province' => $billingAddress['state_province'] ?? NULL,
+        'state_province_abbreviation' => $billingAddress['state_province_abbreviation'] ?? NULL,
         // Kept for backwards compatibility
-        'stateProvinceAbbreviation' => CRM_Utils_Array::value('state_province_abbreviation', $billingAddress),
-        'country' => CRM_Utils_Array::value('country', $billingAddress),
+        'stateProvinceAbbreviation' => $billingAddress['state_province_abbreviation'] ?? NULL,
+        'country' => $billingAddress['country'] ?? NULL,
         'is_pay_later' => $contribution->is_pay_later,
         'organization_name' => $contribution->_relatedObjects['contact']->organization_name,
         'domain_organization' => $domain->name,
index 8650ac02c7db0d6d5237decdc421ea903bb09bc5..bf30652232ef64a2aed185e60a5077034efcff69 100644 (file)
@@ -36,8 +36,8 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
     if (!empty($formValues['email_options'])) {
       $returnProperties['email'] = $returnProperties['on_hold'] = $returnProperties['is_deceased'] = $returnProperties['do_not_email'] = 1;
       $emailParams = [
-        'subject' => CRM_Utils_Array::value('subject', $formValues),
-        'from' => CRM_Utils_Array::value('from_email_address', $formValues),
+        'subject' => $formValues['subject'] ?? NULL,
+        'from' => $formValues['from_email_address'] ?? NULL,
       ];
 
       $emailParams['from'] = CRM_Utils_Mail::formatFromAddress($emailParams['from']);
index 5bc8cf306e04c8afa2fd1e7b3b33e2bcde12246f..9f2bfe6d0d076884b74a7f69d67c0a9407956974 100644 (file)
@@ -266,9 +266,9 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
       // onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE
       if (!empty($paramValues['invoice_id']) || !empty($paramValues['trxn_id']) || !empty($paramValues['contribution_id'])) {
         $dupeIds = [
-          'id' => CRM_Utils_Array::value('contribution_id', $paramValues),
-          'trxn_id' => CRM_Utils_Array::value('trxn_id', $paramValues),
-          'invoice_id' => CRM_Utils_Array::value('invoice_id', $paramValues),
+          'id' => $paramValues['contribution_id'] ?? NULL,
+          'trxn_id' => $paramValues['trxn_id'] ?? NULL,
+          'invoice_id' => $paramValues['invoice_id'] ?? NULL,
         ];
 
         $ids['contribution'] = CRM_Contribute_BAO_Contribution::checkDuplicateIds($dupeIds);
index 001787d2f3499fbeaacc36cc1ba092cc71f90965..edee3b3d8a4e530f78d92411e14d2f28c2a566bb 100644 (file)
@@ -312,7 +312,7 @@ class CRM_Core_BAO_Block {
       }
       $contactFields = [
         'contact_id' => $contactId,
-        'location_type_id' => CRM_Utils_Array::value('location_type_id', $value),
+        'location_type_id' => $value['location_type_id'] ?? NULL,
       ];
 
       $contactFields['is_primary'] = 0;
index 1bfd2a634c3be58b2d625efd7a28ef32d23f2edd..84144bb16677199ba1b5331a83c988ef95138b7a 100644 (file)
@@ -1918,11 +1918,11 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1,
             $details[$groupID][$values['id']]['collapse_adv_display'] = CRM_Utils_Array::value('collapse_adv_display', $group);
             $details[$groupID][$values['id']]['style'] = CRM_Utils_Array::value('style', $group);
             $details[$groupID][$values['id']]['fields'][$k] = [
-              'field_title' => CRM_Utils_Array::value('label', $properties),
-              'field_type' => CRM_Utils_Array::value('html_type', $properties),
-              'field_data_type' => CRM_Utils_Array::value('data_type', $properties),
+              'field_title' => $properties['label'] ?? NULL,
+              'field_type' => $properties['html_type'] ?? NULL,
+              'field_data_type' => $properties['data_type'] ?? NULL,
               'field_value' => CRM_Core_BAO_CustomField::displayValue($values['data'], $properties['id'], $entityId),
-              'options_per_line' => CRM_Utils_Array::value('options_per_line', $properties),
+              'options_per_line' => $properties['options_per_line'] ?? NULL,
             ];
             // editable = whether this set contains any non-read-only fields
             if (!isset($details[$groupID][$values['id']]['editable'])) {
index 0b352b4c097b6dad02c151f8738ce9aa6edac362..6eed0a67f7c083806cee6a63d4ba8df951fbe7a6 100644 (file)
@@ -345,7 +345,7 @@ class CRM_Core_BAO_CustomValueTable {
           'custom_group_id' => $customValue['custom_group_id'],
           'table_name' => $customValue['table_name'],
           'column_name' => $customValue['column_name'],
-          'is_multiple' => CRM_Utils_Array::value('is_multiple', $customValue),
+          'is_multiple' => $customValue['is_multiple'] ?? NULL,
           'file_id' => $customValue['file_id'],
         ];
 
index b45df60c31f7739b1fd25f25c280a013f07706ae..a6388e15c24a1045277fea371a1688507e09e964 100644 (file)
@@ -120,7 +120,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
           'label' => $item['dashboard_id.label'],
           'url' => $item['dashboard_id.url'],
           'cache_minutes' => $item['dashboard_id.cache_minutes'],
-          'fullscreen_url' => CRM_Utils_Array::value('dashboard_id.fullscreen_url', $item),
+          'fullscreen_url' => $item['dashboard_id.fullscreen_url'] ?? NULL,
         ];
       }
     }
@@ -203,7 +203,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
             'label' => $dashlet['label'],
             'cache_minutes' => $dashlet['cache_minutes'],
             'url' => $dashlet['url'],
-            'fullscreen_url' => CRM_Utils_Array::value('fullscreen_url', $dashlet),
+            'fullscreen_url' => $dashlet['fullscreen_url'] ?? NULL,
           ];
         }
       }
index 113efbf308b5f4aa5938d61c5de841066c282a36..4ab15a1d23e29f673cc99fd104db0b6c61263425 100644 (file)
@@ -348,8 +348,8 @@ WHERE ceft.entity_id = %1";
         'to_financial_account_id' => CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['financial_type_id'], $toFinancialAccountType),
         'from_financial_account_id' => CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['financial_type_id'], $fromFinancialAccountType),
         'trxn_date' => date('YmdHis'),
-        'total_amount' => !empty($params['cost']) ? $params['cost'] : 0,
-        'currency' => CRM_Utils_Array::value('currency', $params),
+        'total_amount' => $params['cost'] ?? 0,
+        'currency' => $params['currency'] ?? NULL,
         'status_id' => array_search('Completed', $contributionStatuses),
         'entity_table' => 'civicrm_contribution',
         'entity_id' => $params['contributionId'],
@@ -364,9 +364,9 @@ WHERE ceft.entity_id = %1";
       $productDetails = [];
       CRM_Contribute_BAO_Product::retrieve($premiumParams, $productDetails);
       $params = [
-        'cost' => CRM_Utils_Array::value('cost', $productDetails),
-        'currency' => CRM_Utils_Array::value('currency', $productDetails),
-        'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $productDetails),
+        'cost' => $productDetails['cost'] ?? NULL,
+        'currency' => $productDetails['currency'] ?? NULL,
+        'financial_type_id' => $productDetails['financial_type_id'] ?? NULL,
         'contributionId' => $params['oldPremium']['contribution_id'],
         'isDeleted' => TRUE,
       ];
index 623dd412dee1d8395bf91d3984ffd71ed0d403fc..2ef3afb41180a662e128aa831ee50eaeb7fef1b5 100644 (file)
@@ -333,10 +333,10 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
       $allTags[$id] = [
         'text' => $tag['name'],
         'id' => $id,
-        'description' => CRM_Utils_Array::value('description', $tag),
-        'parent_id' => CRM_Utils_Array::value('parent_id', $tag),
-        'used_for' => CRM_Utils_Array::value('used_for', $tag),
-        'color' => CRM_Utils_Array::value('color', $tag),
+        'description' => $tag['description'] ?? NULL,
+        'parent_id' => $tag['parent_id'] ?? NULL,
+        'used_for' => $tag['used_for'] ?? NULL,
+        'color' => $tag['color'] ?? NULL,
       ];
       if (!$allowSelectingNonSelectable && empty($tag['is_selectable'])) {
         $allTags[$id]['disabled'] = TRUE;
index 43995fc5558efc060964990dbd0fed2397bf397c..4fad6876a8915e4851f49b179137ee4831dd7738 100644 (file)
@@ -504,7 +504,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
       ),
       'skipDisplay' => 0,
       'data_type' => CRM_Utils_Type::getDataTypeFromFieldMetadata($fieldMetaData),
-      'bao' => CRM_Utils_Array::value('bao', $fieldMetaData),
+      'bao' => $fieldMetaData['bao'] ?? NULL,
     ];
 
     $formattedField = CRM_Utils_Date::addDateMetadataToField($fieldMetaData, $formattedField);
index f481131cc0e044e09dc7a424dc89d0469c65456d..e1bfa5a40ff5396df23d7d9c25912bf6e825cdde 100644 (file)
@@ -350,7 +350,7 @@ class CRM_Core_Menu {
 
       $value = array(
         'title' => $item['title'],
-        'desc' => CRM_Utils_Array::value('desc', $item),
+        'desc' => $item['desc'] ?? NULL,
         'id' => strtr($item['title'], array(
           '(' => '_',
           ')' => '',
@@ -366,8 +366,8 @@ class CRM_Core_Menu {
           // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
           TRUE
         ),
-        'icon' => CRM_Utils_Array::value('icon', $item),
-        'extra' => CRM_Utils_Array::value('extra', $item),
+        'icon' => $item['icon'] ?? NULL,
+        'extra' => $item['extra'] ?? NULL,
       );
       if (!array_key_exists($item['adminGroup'], $values)) {
         $values[$item['adminGroup']] = array();
index 6611efbea2c595f2425945b25bdd0c18c5439c14..cb71dbd438d304f92465b147ec632bda2459cf9e 100644 (file)
@@ -939,7 +939,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
         't3' => ucfirst(substr($params['frequency_unit'], 0, 1)),
         'src' => 1,
         'sra' => 1,
-        'srt' => CRM_Utils_Array::value('installments', $params),
+        'srt' => $params['installments'] ?? NULL,
         'no_note' => 1,
         'modify' => 0,
       ];
index 064cad9797b6ecc244645fc5c09651b43147d448..3078e8f84cd116238c0fc041d0f7758475fb94ec 100644 (file)
@@ -233,8 +233,8 @@ class CRM_Core_PseudoConstant {
       // Merge params with schema defaults
       $params += [
         'condition' => CRM_Utils_Array::value('condition', $pseudoconstant, []),
-        'keyColumn' => CRM_Utils_Array::value('keyColumn', $pseudoconstant),
-        'labelColumn' => CRM_Utils_Array::value('labelColumn', $pseudoconstant),
+        'keyColumn' => $pseudoconstant['keyColumn'] ?? NULL,
+        'labelColumn' => $pseudoconstant['labelColumn'] ?? NULL,
       ];
 
       // Fetch option group from option_value table
index ab60fa1d336d73485e8f1892ed6128907990b834..da2eb78f098b7852d8842f1785813a66df51191e 100644 (file)
@@ -251,14 +251,14 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
       $regexp = preg_replace('/[.,;:!?]/', '', CRM_Utils_Array::value(0, $values));
       $importableFields[$key] = [
         'name' => $key,
-        'title' => CRM_Utils_Array::value('label', $values),
+        'title' => $values['label'] ?? NULL,
         'headerPattern' => '/' . preg_quote($regexp, '/') . '/',
         'import' => 1,
         'custom_field_id' => $id,
-        'options_per_line' => CRM_Utils_Array::value('options_per_line', $values),
-        'data_type' => CRM_Utils_Array::value('data_type', $values),
-        'html_type' => CRM_Utils_Array::value('html_type', $values),
-        'is_search_range' => CRM_Utils_Array::value('is_search_range', $values),
+        'options_per_line' => $values['options_per_line'] ?? NULL,
+        'data_type' => $values['data_type'] ?? NULL,
+        'html_type' => $values['html_type'] ?? NULL,
+        'is_search_range' => $values['is_search_range'] ?? NULL,
       ];
       if (CRM_Utils_Array::value('html_type', $values) == 'Select Date') {
         $importableFields[$key]['date_format'] = CRM_Utils_Array::value('date_format', $values);
index ec04f44f1e7e6d47bab9e77b7753593a65df8462..29252fc27ef905ca99499734a7f96c6b885759df 100644 (file)
@@ -1147,10 +1147,10 @@ WHERE civicrm_event.is_active = 1
         }
         $tplParams = array_merge($values, $participantParams, [
           'email' => $email,
-          'confirm_email_text' => CRM_Utils_Array::value('confirm_email_text', $values['event']),
-          'isShowLocation' => CRM_Utils_Array::value('is_show_location', $values['event']),
+          'confirm_email_text' => $values['event']['confirm_email_text'] ?? NULL,
+          'isShowLocation' => $values['event']['is_show_location'] ?? NULL,
           // The concept of contributeMode is deprecated.
-          'contributeMode' => CRM_Utils_Array::value('contributeMode', $template->_tpl_vars),
+          'contributeMode' => $template->_tpl_vars['contributeMode'] ?? NULL,
           'customPre' => $profilePre[0],
           'customPre_grouptitle' => empty($profilePre[1]) ? NULL : [CRM_Core_BAO_UFGroup::getFrontEndTitle((int) $preProfileID)],
           'customPost' => $profilePost[0],
@@ -2212,8 +2212,8 @@ WHERE  ce.loc_block_id = $locBlockId";
 
         $fromEmailValues['from_email_id'][$eventEmailId] = htmlspecialchars($eventEmailId);
         $fromEmailId = [
-          'cc' => CRM_Utils_Array::value('cc_confirm', $eventEmail),
-          'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventEmail),
+          'cc' => $eventEmail['cc_confirm'] ?? NULL,
+          'bcc' => $eventEmail['bcc_confirm'] ?? NULL,
         ];
         $fromEmailValues = array_merge($fromEmailValues, $fromEmailId);
       }
index d1c100ae3b52248de00f9c2bf8604eaa93a925b8..ed598bd5ce864937868cc4f34637abc57aac1716 100644 (file)
@@ -1465,8 +1465,8 @@ UPDATE  civicrm_participant
             'domain' => $domainValues,
             'participant' => $participantValues,
             'event' => $eventDetails,
-            'paidEvent' => CRM_Utils_Array::value('is_monetary', $eventDetails),
-            'isShowLocation' => CRM_Utils_Array::value('is_show_location', $eventDetails),
+            'paidEvent' => $eventDetails['is_monetary'] ?? NULL,
+            'isShowLocation' => $eventDetails['is_show_location'] ?? NULL,
             'isAdditional' => $participantValues['registered_by_id'],
             'isExpired' => $mailType == 'Expired',
             'isConfirm' => $mailType == 'Confirm',
@@ -1475,8 +1475,8 @@ UPDATE  civicrm_participant
           'from' => $receiptFrom,
           'toName' => $participantName,
           'toEmail' => $toEmail,
-          'cc' => CRM_Utils_Array::value('cc_confirm', $eventDetails),
-          'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventDetails),
+          'cc' => $eventDetails['cc_confirm'] ?? NULL,
+          'bcc' => $eventDetails['bcc_confirm'] ?? NULL,
         ]
       );
 
index 5d307df7be8285ccd2a2a2d55e26107fdac295a3..0b672a168901e21b599c0d66af2bfcf3dbaa730a 100644 (file)
@@ -49,7 +49,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant {
    */
   public static function create(&$params) {
     $participantParams = [
-      'id' => CRM_Utils_Array::value('id', $params),
+      'id' => $params['id'] ?? NULL,
       'role_id' => self::get_attendee_role_id(),
       'status_id' => self::get_pending_in_cart_status_id(),
       'contact_id' => $params['contact_id'],
index 5f79f4ec27f73142a0086c7bd68c69a2e662715d..96a64ead5633c3f4b53c3763178eb8b9eb9a9ca0 100644 (file)
@@ -40,7 +40,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
       'source' => CRM_Utils_Array::value('participant_source', $params, $this->description),
       'is_pay_later' => $this->is_pay_later,
       'fee_amount' => CRM_Utils_Array::value('amount', $params, 0),
-      'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
+      'fee_currency' => $params['currencyID'] ?? NULL,
     ];
 
     if ($participant->must_wait) {
@@ -559,7 +559,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
     $trxnDetails = [
       'trxn_id' => $result['trxn_id'],
       'trxn_date' => $result['now'],
-      'currency' => CRM_Utils_Array::value('currencyID', $result),
+      'currency' => $result['currencyID'] ?? NULL,
     ];
     return $trxnDetails;
   }
@@ -594,12 +594,12 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
       'net_amount' => $params['amount'],
       'invoice_id' => "{$params['invoiceID']}-{$this->sub_trxn_index}",
       'trxn_id' => "{$params['trxn_id']}-{$this->sub_trxn_index}",
-      'currency' => CRM_Utils_Array::value('currencyID', $params),
+      'currency' => $params['currencyID'] ?? NULL,
       'source' => $event->title,
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
       'contribution_status_id' => $params['contribution_status_id'],
       'payment_instrument_id' => $params['payment_instrument_id'],
-      'check_number' => CRM_Utils_Array::value('check_number', $params),
+      'check_number' => $params['check_number'] ?? NULL,
       'skipLineItem' => 1,
     ];
 
index ed1476c4ae3fdc10ee6f07fdc9a57a253b554f6e..9a955b3cba99bbe4d7d357e338b2cf20b07408a8 100644 (file)
@@ -2046,9 +2046,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       'currency' => $params['currencyID'],
       'source' => !empty($params['participant_source']) ? $params['participant_source'] : $params['description'],
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
-      'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
-      'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
+      'campaign_id' => $params['campaign_id'] ?? NULL,
+      'card_type_id' => $params['card_type_id'] ?? NULL,
+      'pan_truncation' => $params['pan_truncation'] ?? NULL,
     ];
 
     if ($paymentProcessor) {
@@ -2058,7 +2058,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
     if (!$pending && $result) {
       $contribParams += [
-        'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
+        'fee_amount' => $result['fee_amount'] ?? NULL,
         'trxn_id' => $result['trxn_id'],
         'receipt_date' => $receiptDate,
       ];
@@ -2125,7 +2125,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
     $participantFields = CRM_Event_DAO_Participant::fields();
     $participantParams = [
-      'id' => CRM_Utils_Array::value('participant_id', $params),
+      'id' => $params['participant_id'] ?? NULL,
       'contact_id' => $contactID,
       'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
       'status_id' => CRM_Utils_Array::value('participant_status',
@@ -2137,13 +2137,13 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
         $participantFields['participant_source']['maxlength']
       ),
-      'fee_level' => CRM_Utils_Array::value('amount_level', $params),
+      'fee_level' => $params['amount_level'] ?? NULL,
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
-      'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
-      'registered_by_id' => CRM_Utils_Array::value('registered_by_id', $params),
-      'discount_id' => CRM_Utils_Array::value('discount_id', $params),
-      'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+      'fee_amount' => $params['fee_amount'] ?? NULL,
+      'registered_by_id' => $params['registered_by_id'] ?? NULL,
+      'discount_id' => $params['discount_id'] ?? NULL,
+      'fee_currency' => $params['currencyID'] ?? NULL,
+      'campaign_id' => $params['campaign_id'] ?? NULL,
     ];
 
     if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
index 5e163d768baf5abae74c11fb1fe811deda90ad7e..007e9b40176e948ecc7df48c2051d69e8ad30865 100644 (file)
@@ -800,7 +800,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
 
     $participantFields = CRM_Event_DAO_Participant::fields();
     $participantParams = array(
-      'id' => CRM_Utils_Array::value('participant_id', $params),
+      'id' => $params['participant_id'] ?? NULL,
       'contact_id' => $contactID,
       'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
       'status_id' => CRM_Utils_Array::value('participant_status',
@@ -812,13 +812,13 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
         isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
         $participantFields['participant_source']['maxlength']
       ),
-      'fee_level' => CRM_Utils_Array::value('amount_level', $params),
+      'fee_level' => $params['amount_level'] ?? NULL,
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
-      'fee_amount' => CRM_Utils_Array::value('fee_amount', $params),
-      'registered_by_id' => CRM_Utils_Array::value('registered_by_id', $params),
-      'discount_id' => CRM_Utils_Array::value('discount_id', $params),
-      'fee_currency' => CRM_Utils_Array::value('currencyID', $params),
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+      'fee_amount' => $params['fee_amount'] ?? NULL,
+      'registered_by_id' => $params['registered_by_id'] ?? NULL,
+      'discount_id' => $params['discount_id'] ?? NULL,
+      'fee_currency' => $params['currencyID'] ?? NULL,
+      'campaign_id' => $params['campaign_id'] ?? NULL,
     );
 
     if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
index 735679d5793f335eed8e67f3580520d3ca5a1da7..060df998c8c8df3b54ae7c55c7559d4dc3e65cc0 100644 (file)
@@ -939,9 +939,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
       'currency' => $params['currencyID'],
       'source' => !empty($params['participant_source']) ? $params['participant_source'] : $params['description'],
       'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
-      'card_type_id' => CRM_Utils_Array::value('card_type_id', $params),
-      'pan_truncation' => CRM_Utils_Array::value('pan_truncation', $params),
+      'campaign_id' => $params['campaign_id'] ?? NULL,
+      'card_type_id' => $params['card_type_id'] ?? NULL,
+      'pan_truncation' => $params['pan_truncation'] ?? NULL,
     ];
 
     if ($paymentProcessor) {
@@ -951,7 +951,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
 
     if (!$pending && $result) {
       $contribParams += [
-        'fee_amount' => CRM_Utils_Array::value('fee_amount', $result),
+        'fee_amount' => $result['fee_amount'] ?? NULL,
         'trxn_id' => $result['trxn_id'],
         'receipt_date' => $receiptDate,
       ];
index 45698864261ba9babea9462318f3d030c33a8c70..487138ebe232b85859d72ac8367e85c98eb0b51a 100644 (file)
@@ -462,8 +462,8 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
         'from' => $receiptFrom,
         'toName' => $participantName,
         'toEmail' => $toEmail,
-        'cc' => CRM_Utils_Array::value('cc_confirm', $eventDetails),
-        'bcc' => CRM_Utils_Array::value('bcc_confirm', $eventDetails),
+        'cc' => $eventDetails['cc_confirm'] ?? NULL,
+        'bcc' => $eventDetails['bcc_confirm'] ?? NULL,
       ];
       CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
     }
index 664105fabea172ef438892b604804465ee88174f..e78686c32510736349d40cfe7d46ca3e26a5ec73 100644 (file)
@@ -297,8 +297,8 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
     $session = CRM_Core_Session::singleton();
     $params = [
       'contact_id' => $session->get('userID'),
-      'event_id' => CRM_Utils_Array::value('id', $values['event']),
-      'role_id' => CRM_Utils_Array::value('default_role_id', $values['event']),
+      'event_id' => $values['event']['id'] ?? NULL,
+      'role_id' => $values['event']['default_role_id'] ?? NULL,
     ];
 
     if ($eventFullMessage && ($noFullMsg == 'false') || CRM_Event_BAO_Event::checkRegistration($params)) {
index 7cd09259cc78d89a4f583ed3358097559691252f..9f5e0ad55032077a1845521db525d6072ee96f7c 100644 (file)
@@ -303,12 +303,12 @@ class CRM_Financial_BAO_Payment {
       'amountOwed' => $entities['payment']['balance'],
       'totalPaid' => $entities['payment']['paid'],
       'paymentAmount' => $entities['payment']['total_amount'],
-      'checkNumber' => CRM_Utils_Array::value('check_number', $entities['payment']),
+      'checkNumber' => $entities['payment']['check_number'] ?? NULL,
       'receive_date' => $entities['payment']['trxn_date'],
       'paidBy' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $entities['payment']['payment_instrument_id']),
       'isShowLocation' => (!empty($entities['event']) ? $entities['event']['is_show_location'] : FALSE),
-      'location' => CRM_Utils_Array::value('location', $entities),
-      'event' => CRM_Utils_Array::value('event', $entities),
+      'location' => $entities['location'] ?? NULL,
+      'event' => $entities['event'] ?? NULL,
       'component' => (!empty($entities['event']) ? 'event' : 'contribution'),
       'isRefund' => $entities['payment']['total_amount'] < 0,
       'isAmountzero' => $entities['payment']['total_amount'] === 0,
index 8aa8539e22cb9e5109017d500d361d7d34ce6d79..06acbd9521b94cb7ca4194fc99f4a171f39bf6d0 100644 (file)
@@ -150,7 +150,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form {
     $params = [
       'id' => $this->_id,
       'payment_instrument_id' => $this->_submitValues['payment_instrument_id'],
-      'trxn_id' => CRM_Utils_Array::value('trxn_id', $this->_submitValues),
+      'trxn_id' => $this->_submitValues['trxn_id'] ?? NULL,
       'trxn_date' => CRM_Utils_Array::value('trxn_date', $this->_submitValues, date('YmdHis')),
     ];
 
index 773009cb28dba67b29fad787bd6802ea521214cb..2d140e7826568331b21f274d8f88a10dbaad5482 100644 (file)
@@ -119,7 +119,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend {
       'details' => $params['suggested_message'],
       'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Completed'),
       'is_test' => $params['is_test'],
-      'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+      'campaign_id' => $params['campaign_id'] ?? NULL,
     ];
 
     // activity creation
index 75c01b2bcfca9ac5b4325d5d3f21abb371405064..6767b8f3ccc3f48d0171101725dc3ca628604ee6 100644 (file)
@@ -240,8 +240,8 @@ WHERE lt.log_conn_id = %1
           'action' => $changed['log_action'],
           'id' => $id,
           'field' => $diff,
-          'from' => CRM_Utils_Array::value($diff, $original),
-          'to' => CRM_Utils_Array::value($diff, $changed),
+          'from' => $original[$diff] ?? NULL,
+          'to' => $changed[$diff] ?? NULL,
           'table' => $table,
           'log_date' => $changed['log_date'],
           'log_conn_id' => $changed['log_conn_id'],
index cb5b159017f1427039de88ea09f9f4f5c65f5cf8..a8265b8a67b618c7814bab4e2d7665a6bb590ba4 100644 (file)
@@ -2052,7 +2052,7 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = membership.contact_id AND
       'price_sets' => $priceSets,
       'fields' => $fields,
       'price_fields' => [
-        'price_' . $fieldID => CRM_Utils_Array::value('id', $results),
+        'price_' . $fieldID => $results['id'] ?? NULL,
       ],
     ];
     return $returnParams;
index 8129a226b549aca5c2f3132dfc6c850ce7fd3f3b..bf26de3d4eefc9dc28ec8a6e3640c8e9cf641e52 100644 (file)
@@ -510,12 +510,12 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
       // - set the payment information block
       // - set the max related block
       $allMembershipInfo[$key] = [
-        'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $values),
+        'financial_type_id' => $values['financial_type_id'] ?? NULL,
         'total_amount' => CRM_Utils_Money::format($totalAmount, NULL, '%a'),
         'total_amount_numeric' => $totalAmount,
-        'auto_renew' => CRM_Utils_Array::value('auto_renew', $values),
+        'auto_renew' => $values['auto_renew'] ?? NULL,
         'has_related' => isset($values['relationship_type_id']),
-        'max_related' => CRM_Utils_Array::value('max_related', $values),
+        'max_related' => $values['max_related'] ?? NULL,
       ];
     }
 
@@ -1374,10 +1374,10 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
             'contact_id' => $this->_contributorContactID,
             'line_item' => $lineItem,
             'is_test' => $isTest,
-            'campaign_id' => CRM_Utils_Array::value('campaign_id', $paymentParams),
-            'contribution_page_id' => CRM_Utils_Array::value('contribution_page_id', $formValues),
+            'campaign_id' => $paymentParams['campaign_id'] ?? NULL,
+            'contribution_page_id' => $formValues['contribution_page_id'] ?? NULL,
             'source' => CRM_Utils_Array::value('source', $paymentParams, CRM_Utils_Array::value('description', $paymentParams)),
-            'thankyou_date' => CRM_Utils_Array::value('thankyou_date', $paymentParams),
+            'thankyou_date' => $paymentParams['thankyou_date'] ?? NULL,
             'payment_instrument_id' => $paymentInstrumentID,
           ],
           $financialType,
index f6e50c2d87cbe207b6c42c0a84a24fb0356a0f83..9b4f1d749125d8485b25c60a746d8f1de9e13638 100644 (file)
@@ -286,7 +286,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
         // build membership info array, which is used to set the payment information block when
         // membership type is selected.
         $allMembershipInfo[$key] = [
-          'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $values),
+          'financial_type_id' => $values['financial_type_id'] ?? NULL,
           'total_amount' => CRM_Utils_Money::format($totalAmount, NULL, '%a'),
           'total_amount_numeric' => $totalAmount,
           'tax_message' => $taxAmount ? ts("Includes %1 amount of %2", [1 => $this->getSalesTaxTerm(), 2 => CRM_Utils_Money::format($taxAmount)]) : $taxAmount,
index b3f212a4f0b18b59592752e356815c31bb3e05cc..db184562e945d5f7e90989c83021e34de65fd8cd 100644 (file)
@@ -114,7 +114,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form {
           'end_date' => CRM_Utils_Date::processDate($owner['end_date'], NULL, TRUE, 'Ymd'),
           'source' => ts('Manual Assignment of Related Membership'),
           'is_test' => $owner['is_test'],
-          'campaign_id' => CRM_Utils_Array::value('campaign_id', $owner),
+          'campaign_id' => $owner['campaign_id'] ?? NULL,
           'status_id' => $owner['status_id'],
           'skipStatusCal' => TRUE,
           'createActivity' => TRUE,
index ef21f1a79cc72a672f7058c4f92885d2c29a413e..fbe7a757d0fbfaeff4b4715bd58c64e98becb0d0 100644 (file)
@@ -524,14 +524,14 @@ GROUP BY  currency
             $contributionParams, $contributionStatus, $returnProperties
           );
           $contributionValue = array(
-            'status' => CRM_Utils_Array::value('contribution_status_id', $contributionStatus),
-            'receive_date' => CRM_Utils_Array::value('receive_date', $contributionStatus),
+            'status' => $contributionStatus['contribution_status_id'] ?? NULL,
+            'receive_date' => $contributionStatus['receive_date'] ?? NULL,
           );
         }
         $payments[$payID] = array_merge($contributionValue,
           array(
-            'amount' => CRM_Utils_Array::value('scheduled_amount', $values),
-            'due_date' => CRM_Utils_Array::value('scheduled_date', $values),
+            'amount' => $values['scheduled_amount'] ?? NULL,
+            'due_date' => $values['scheduled_date'] ?? NULL,
           )
         );
 
@@ -683,7 +683,7 @@ GROUP BY  currency
         'is_test' => $params['is_test'],
         'status_id' => 2,
         'details' => $details,
-        'campaign_id' => CRM_Utils_Array::value('campaign_id', $params),
+        'campaign_id' => $params['campaign_id'] ?? NULL,
       );
 
       // lets insert assignee record.
index 6935d239bbad5a902a0ec75170383608add914fc..1ac0016cda07faa28411a3462565efa001a397a6 100644 (file)
@@ -229,7 +229,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
         foreach ($overduePayments as $id => $payment) {
           $label = ts("%1 - due on %2 (overdue)", array(
             1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $payment), CRM_Utils_Array::value('scheduled_amount_currency', $payment)),
-            2 => CRM_Utils_Array::value('scheduled_date', $payment),
+            2 => $payment['scheduled_date'] ?? NULL,
           ));
           $paymentID = CRM_Utils_Array::value('id', $payment);
           $payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $payment)));
@@ -239,7 +239,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
       if (!empty($nextPayment)) {
         $label = ts("%1 - due on %2", array(
           1 => CRM_Utils_Money::format(CRM_Utils_Array::value('scheduled_amount', $nextPayment), CRM_Utils_Array::value('scheduled_amount_currency', $nextPayment)),
-          2 => CRM_Utils_Array::value('scheduled_date', $nextPayment),
+          2 => $nextPayment['scheduled_date'] ?? NULL,
         ));
         $paymentID = CRM_Utils_Array::value('id', $nextPayment);
         $payments[] = $form->createElement('checkbox', $paymentID, NULL, $label, array('amount' => CRM_Utils_Array::value('scheduled_amount', $nextPayment)));
index c1f017f435a2cf04ef4b014af9a9428e2a9e1371..9c5b9bd58c0c5de7b6d4311742f958b0ea749742 100644 (file)
@@ -342,21 +342,21 @@ WHERE li.contribution_id = %1";
       $values[$oid] = [
         'price_field_id' => $fid,
         'price_field_value_id' => $oid,
-        'label' => CRM_Utils_Array::value('label', $options[$oid]),
+        'label' => $options[$oid]['label'] ?? NULL,
         'field_title' => $fieldTitle,
-        'description' => CRM_Utils_Array::value('description', $options[$oid]),
+        'description' => $options[$oid]['description'] ?? NULL,
         'qty' => $qty,
         'unit_price' => $price,
         'line_total' => $qty * $price,
         'participant_count' => $qty * $participantsPerField,
-        'max_value' => CRM_Utils_Array::value('max_value', $options[$oid]),
-        'membership_type_id' => CRM_Utils_Array::value('membership_type_id', $options[$oid]),
-        'membership_num_terms' => CRM_Utils_Array::value('membership_num_terms', $options[$oid]),
-        'auto_renew' => CRM_Utils_Array::value('auto_renew', $options[$oid]),
+        'max_value' => $options[$oid]['max_value'] ?? NULL,
+        'membership_type_id' => $options[$oid]['membership_type_id'] ?? NULL,
+        'membership_num_terms' => $options[$oid]['membership_num_terms'] ?? NULL,
+        'auto_renew' => $options[$oid]['auto_renew'] ?? NULL,
         'html_type' => $fields['html_type'],
-        'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $options[$oid]),
+        'financial_type_id' => $options[$oid]['financial_type_id'] ?? NULL,
         'tax_amount' => CRM_Utils_Array::value('tax_amount', $options[$oid], 0),
-        'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $options[$oid]),
+        'non_deductible_amount' => $options[$oid]['non_deductible_amount'] ?? NULL,
       ];
 
       if ($values[$oid]['membership_type_id'] && empty($values[$oid]['auto_renew'])) {
index 4325c883157b06776380e314e3d66b15846f7ca1..a65ec27c09afc05abde6d43bd2e1a8acf987bc79 100644 (file)
@@ -145,7 +145,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
           'is_active' => 1,
           'is_default' => !empty($defaultArray[$params['option_weight'][$index]]) ? $defaultArray[$params['option_weight'][$index]] : 0,
           'membership_num_terms' => NULL,
-          'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $params),
+          'non_deductible_amount' => $params['non_deductible_amount'] ?? NULL,
           'visibility_id' => CRM_Utils_Array::value($index, CRM_Utils_Array::value('option_visibility_id', $params), self::getVisibilityOptionID('public')),
         ];
 
index 47adf78eed1b64a28ccf515bca0fe5131f50c409..9690867ff6d4bdcedfb4c63280c5d789310139ca 100644 (file)
@@ -3378,7 +3378,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
             }
             if ($value && empty($field['no_display'])) {
               $statistics['filters'][] = [
-                'title' => CRM_Utils_Array::value('title', $field),
+                'title' => $field['title'] ?? NULL,
                 'value' => CRM_Utils_String::htmlToText($value),
               ];
             }
index 1f7d6cc38101dae681a3e18352f6a2f0bbee69d4..64d8952e714a8941907b8a1ab43ab64de0a38d99 100644 (file)
@@ -509,7 +509,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
 
       $this->_columnHeaders['case_activity_all_dates'] = [
         'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] . ": {$this->caseActivityTypes[$activityType]}",
-        'type' => CRM_Utils_Array::value('type', $this->_caseDetailExtra['case_activity_all_dates']),
+        'type' => $this->_caseDetailExtra['case_activity_all_dates']['type'] ?? NULL,
       ];
     }
 
index 0358f34d14673245da9989bc5910a17a15d9321b..6e1eb1c61bde0394580a293bad3897a55946e6f0 100644 (file)
@@ -101,54 +101,54 @@ class CRM_Utils_Address {
     if (!$microformat) {
       // replacements in case of Individual Name Format
       $replacements = [
-        'contact.display_name' => CRM_Utils_Array::value('display_name', $fields),
-        'contact.individual_prefix' => CRM_Utils_Array::value('individual_prefix', $fields),
-        'contact.formal_title' => CRM_Utils_Array::value('formal_title', $fields),
-        'contact.first_name' => CRM_Utils_Array::value('first_name', $fields),
-        'contact.middle_name' => CRM_Utils_Array::value('middle_name', $fields),
-        'contact.last_name' => CRM_Utils_Array::value('last_name', $fields),
-        'contact.individual_suffix' => CRM_Utils_Array::value('individual_suffix', $fields),
-        'contact.address_name' => CRM_Utils_Array::value('address_name', $fields),
-        'contact.street_address' => CRM_Utils_Array::value('street_address', $fields),
-        'contact.supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1', $fields),
-        'contact.supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2', $fields),
-        'contact.supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3', $fields),
-        'contact.city' => CRM_Utils_Array::value('city', $fields),
-        'contact.state_province_name' => CRM_Utils_Array::value('state_province_name', $fields),
-        'contact.county' => CRM_Utils_Array::value('county', $fields),
-        'contact.state_province' => CRM_Utils_Array::value('state_province', $fields),
+        'contact.display_name' => $fields['display_name'] ?? NULL,
+        'contact.individual_prefix' => $fields['individual_prefix'] ?? NULL,
+        'contact.formal_title' => $fields['formal_title'] ?? NULL,
+        'contact.first_name' => $fields['first_name'] ?? NULL,
+        'contact.middle_name' => $fields['middle_name'] ?? NULL,
+        'contact.last_name' => $fields['last_name'] ?? NULL,
+        'contact.individual_suffix' => $fields['individual_suffix'] ?? NULL,
+        'contact.address_name' => $fields['address_name'] ?? NULL,
+        'contact.street_address' => $fields['street_address'] ?? NULL,
+        'contact.supplemental_address_1' => $fields['supplemental_address_1'] ?? NULL,
+        'contact.supplemental_address_2' => $fields['supplemental_address_2'] ?? NULL,
+        'contact.supplemental_address_3' => $fields['supplemental_address_3'] ?? NULL,
+        'contact.city' => $fields['city'] ?? NULL,
+        'contact.state_province_name' => $fields['state_province_name'] ?? NULL,
+        'contact.county' => $fields['county'] ?? NULL,
+        'contact.state_province' => $fields['state_province'] ?? NULL,
         'contact.postal_code' => $fullPostalCode,
-        'contact.country' => CRM_Utils_Array::value('country', $fields),
-        'contact.world_region' => CRM_Utils_Array::value('world_region', $fields),
-        'contact.geo_code_1' => CRM_Utils_Array::value('geo_code_1', $fields),
-        'contact.geo_code_2' => CRM_Utils_Array::value('geo_code_2', $fields),
-        'contact.current_employer' => CRM_Utils_Array::value('current_employer', $fields),
-        'contact.nick_name' => CRM_Utils_Array::value('nick_name', $fields),
-        'contact.email' => CRM_Utils_Array::value('email', $fields),
-        'contact.im' => CRM_Utils_Array::value('im', $fields),
-        'contact.do_not_email' => CRM_Utils_Array::value('do_not_email', $fields),
-        'contact.do_not_phone' => CRM_Utils_Array::value('do_not_phone', $fields),
-        'contact.do_not_mail' => CRM_Utils_Array::value('do_not_mail', $fields),
-        'contact.do_not_sms' => CRM_Utils_Array::value('do_not_sms', $fields),
-        'contact.do_not_trade' => CRM_Utils_Array::value('do_not_trade', $fields),
-        'contact.job_title' => CRM_Utils_Array::value('job_title', $fields),
-        'contact.birth_date' => CRM_Utils_Array::value('birth_date', $fields),
-        'contact.gender' => CRM_Utils_Array::value('gender', $fields),
-        'contact.is_opt_out' => CRM_Utils_Array::value('is_opt_out', $fields),
-        'contact.preferred_mail_format' => CRM_Utils_Array::value('preferred_mail_format', $fields),
-        'contact.phone' => CRM_Utils_Array::value('phone', $fields),
-        'contact.home_URL' => CRM_Utils_Array::value('home_URL', $fields),
-        'contact.contact_source' => CRM_Utils_Array::value('contact_source', $fields),
-        'contact.external_identifier' => CRM_Utils_Array::value('external_identifier', $fields),
-        'contact.contact_id' => CRM_Utils_Array::value('id', $fields),
-        'contact.household_name' => CRM_Utils_Array::value('display_name', $fields),
-        'contact.organization_name' => CRM_Utils_Array::value('display_name', $fields),
-        'contact.legal_name' => CRM_Utils_Array::value('legal_name', $fields),
-        'contact.preferred_communication_method' => CRM_Utils_Array::value('preferred_communication_method', $fields),
-        'contact.communication_style' => CRM_Utils_Array::value('communication_style', $fields),
-        'contact.addressee' => CRM_Utils_Array::value('addressee_display', $fields),
-        'contact.email_greeting' => CRM_Utils_Array::value('email_greeting_display', $fields),
-        'contact.postal_greeting' => CRM_Utils_Array::value('postal_greeting_display', $fields),
+        'contact.country' => $fields['country'] ?? NULL,
+        'contact.world_region' => $fields['world_region'] ?? NULL,
+        'contact.geo_code_1' => $fields['geo_code_1'] ?? NULL,
+        'contact.geo_code_2' => $fields['geo_code_2'] ?? NULL,
+        'contact.current_employer' => $fields['current_employer'] ?? NULL,
+        'contact.nick_name' => $fields['nick_name'] ?? NULL,
+        'contact.email' => $fields['email'] ?? NULL,
+        'contact.im' => $fields['im'] ?? NULL,
+        'contact.do_not_email' => $fields['do_not_email'] ?? NULL,
+        'contact.do_not_phone' => $fields['do_not_phone'] ?? NULL,
+        'contact.do_not_mail' => $fields['do_not_mail'] ?? NULL,
+        'contact.do_not_sms' => $fields['do_not_sms'] ?? NULL,
+        'contact.do_not_trade' => $fields['do_not_trade'] ?? NULL,
+        'contact.job_title' => $fields['job_title'] ?? NULL,
+        'contact.birth_date' => $fields['birth_date'] ?? NULL,
+        'contact.gender' => $fields['gender'] ?? NULL,
+        'contact.is_opt_out' => $fields['is_opt_out'] ?? NULL,
+        'contact.preferred_mail_format' => $fields['preferred_mail_format'] ?? NULL,
+        'contact.phone' => $fields['phone'] ?? NULL,
+        'contact.home_URL' => $fields['home_URL'] ?? NULL,
+        'contact.contact_source' => $fields['contact_source'] ?? NULL,
+        'contact.external_identifier' => $fields['external_identifier'] ?? NULL,
+        'contact.contact_id' => $fields['id'] ?? NULL,
+        'contact.household_name' => $fields['display_name'] ?? NULL,
+        'contact.organization_name' => $fields['display_name'] ?? NULL,
+        'contact.legal_name' => $fields['legal_name'] ?? NULL,
+        'contact.preferred_communication_method' => $fields['preferred_communication_method'] ?? NULL,
+        'contact.communication_style' => $fields['communication_style'] ?? NULL,
+        'contact.addressee' => $fields['addressee_display'] ?? NULL,
+        'contact.email_greeting' => $fields['email_greeting_display'] ?? NULL,
+        'contact.postal_greeting' => $fields['postal_greeting_display'] ?? NULL,
       ];
     }
     else {
index b6ebd4e7d6784cd9a90cd020bdba49ef3d39f4ad..31f13860f38fb6336ab0ea9d93082d77d173f4a0 100644 (file)
@@ -595,13 +595,13 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
       $row = CRM_Admin_Page_Extensions::createExtendedInfo($obj);
       switch ($row['status']) {
         case CRM_Extension_Manager::STATUS_INSTALLED_MISSING:
-          $errors[] = ts('%1 extension (%2) is installed but missing files.', [1 => CRM_Utils_Array::value('label', $row), 2 => $key]);
+          $errors[] = ts('%1 extension (%2) is installed but missing files.', [1 => $row['label'] ?? NULL, 2 => $key]);
           break;
 
         case CRM_Extension_Manager::STATUS_INSTALLED:
           if (!empty($remotes[$key]) && version_compare($row['version'], $remotes[$key]->version, '<')) {
             $updates[] = ts('%1 (%2) version %3 is installed. <a %4>Upgrade to version %5</a>.', [
-              1 => CRM_Utils_Array::value('label', $row),
+              1 => $row['label'] ?? NULL,
               2 => $key,
               3 => $row['version'],
               4 => 'href="' . CRM_Utils_System::url('civicrm/admin/extensions', "action=update&id=$key&key=$key") . '"',
index 5accb77e7a393ca3d25fbe6f022d99ecb8f4904d..df20858d5b7e83c10da8783e891207cd52091ea8 100644 (file)
@@ -395,8 +395,8 @@ class CRM_Utils_Date {
       }
 
       $date = [
-        '%b' => CRM_Utils_Array::value($month, $abbrMonths),
-        '%B' => CRM_Utils_Array::value($month, $fullMonths),
+        '%b' => $abbrMonths[$month] ?? NULL,
+        '%B' => $fullMonths[$month] ?? NULL,
         '%d' => $day > 9 ? $day : '0' . $day,
         '%e' => $day > 9 ? $day : ' ' . $day,
         '%E' => $day,
index fc19eaf7fd2c28271638d32ea30dfe9e6907efe0..8e62e1e17b21ae2401e7baf6393f54dd1967001f 100644 (file)
@@ -255,7 +255,7 @@ function _civicrm_api3_deprecated_add_formatted_param(&$values, &$params) {
   if (isset($values['email_greeting'])) {
     if (!empty($params['email_greeting_id'])) {
       $emailGreetingFilter = [
-        'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+        'contact_type' => $params['contact_type'] ?? NULL,
         'greeting_type' => 'email_greeting',
       ];
       $emailGreetings = CRM_Core_PseudoConstant::greeting($emailGreetingFilter);
@@ -271,7 +271,7 @@ function _civicrm_api3_deprecated_add_formatted_param(&$values, &$params) {
   if (isset($values['postal_greeting'])) {
     if (!empty($params['postal_greeting_id'])) {
       $postalGreetingFilter = [
-        'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+        'contact_type' => $params['contact_type'] ?? NULL,
         'greeting_type' => 'postal_greeting',
       ];
       $postalGreetings = CRM_Core_PseudoConstant::greeting($postalGreetingFilter);
@@ -286,7 +286,7 @@ function _civicrm_api3_deprecated_add_formatted_param(&$values, &$params) {
   if (isset($values['addressee'])) {
     if (!empty($params['addressee_id'])) {
       $addresseeFilter = [
-        'contact_type' => CRM_Utils_Array::value('contact_type', $params),
+        'contact_type' => $params['contact_type'] ?? NULL,
         'greeting_type' => 'addressee',
       ];
       $addressee = CRM_Core_PseudoConstant::addressee($addresseeFilter);
index 26bb54c737d9e7e62ae5b68f137729bbe953efbc..e2c4c26e7a81bf3a1c0b7111959497fd4df0bade 100644 (file)
@@ -83,10 +83,10 @@ class CRM_Utils_Pager extends Pager_Sliding {
       'last' => $this->getLastPageLink(),
       'currentPage' => $this->getCurrentPageID(),
       'numPages' => $this->numPages(),
-      'csvString' => CRM_Utils_Array::value('csvString', $params),
-      'status' => CRM_Utils_Array::value('status', $params),
-      'buttonTop' => CRM_Utils_Array::value('buttonTop', $params),
-      'buttonBottom' => CRM_Utils_Array::value('buttonBottom', $params),
+      'csvString' => $params['csvString'] ?? NULL,
+      'status' => $params['status'] ?? NULL,
+      'buttonTop' => $params['buttonTop'] ?? NULL,
+      'buttonBottom' => $params['buttonBottom'] ?? NULL,
       'currentLocation' => $this->getCurrentLocation(),
     ];
 
index f70c76c2e35f146febd21ae4e900146ff571e88e..0b9f3de7abd10072df7fb191355907c04023d03a 100644 (file)
@@ -119,11 +119,11 @@ class CRM_Utils_Recent {
         'type' => $type,
         'contact_id' => $contactId,
         'contactName' => $contactName,
-        'subtype' => CRM_Utils_Array::value('subtype', $others),
+        'subtype' => $others['subtype'] ?? NULL,
         'isDeleted' => CRM_Utils_Array::value('isDeleted', $others, FALSE),
-        'image_url' => CRM_Utils_Array::value('imageUrl', $others),
-        'edit_url' => CRM_Utils_Array::value('editUrl', $others),
-        'delete_url' => CRM_Utils_Array::value('deleteUrl', $others),
+        'image_url' => $others['imageUrl'] ?? NULL,
+        'edit_url' => $others['editUrl'] ?? NULL,
+        'delete_url' => $others['deleteUrl'] ?? NULL,
       ]
     );
 
index cef2fdcb717a4f5031c95c995865fa030fa19fcb..a18e106118a771db529daf88ec90f35a3e04c030 100644 (file)
@@ -106,7 +106,7 @@ class CRM_Utils_Sort {
     foreach ($vars as $weight => $value) {
       $this->_vars[$weight] = [
         'name' => CRM_Utils_Type::validate($value['sort'], 'MysqlColumnNameOrAlias'),
-        'direction' => CRM_Utils_Array::value('direction', $value),
+        'direction' => $value['direction'] ?? NULL,
         'title' => $value['name'],
       ];
     }
index 8a41a70b7c890e71c7f9514e616e83a062638c2d..73f43f05a424a22a35d57535f03fb8e0ed541502 100644 (file)
@@ -689,9 +689,9 @@ function civicrm_api3_activity_delete($params) {
  */
 function _civicrm_api3_activity_check_params(&$params) {
   $activityIds = [
-    'activity' => CRM_Utils_Array::value('id', $params),
-    'parent' => CRM_Utils_Array::value('parent_id', $params),
-    'original' => CRM_Utils_Array::value('original_id', $params),
+    'activity' => $params['id'] ?? NULL,
+    'parent' => $params['parent_id'] ?? NULL,
+    'original' => $params['original_id'] ?? NULL,
   ];
 
   foreach ($activityIds as $id => $value) {
index 3cf80ca99e8b4408485ca54583dbb1da2dbd9813..1f5b9b6ae46a9bf2cfe290692499795b25332b6c 100644 (file)
@@ -145,19 +145,19 @@ function _civicrm_api3_case_create_xmlProcessor($params, $caseBAO) {
   // Initialize XML processor with $params
   $xmlProcessor = new CRM_Case_XMLProcessor_Process();
   $xmlProcessorParams = [
-    'clientID' => CRM_Utils_Array::value('contact_id', $params),
-    'creatorID' => CRM_Utils_Array::value('creator_id', $params),
+    'clientID' => $params['contact_id'] ?? NULL,
+    'creatorID' => $params['creator_id'] ?? NULL,
     'standardTimeline' => 1,
     'activityTypeName' => 'Open Case',
-    'caseID' => CRM_Utils_Array::value('id', $params),
-    'subject' => CRM_Utils_Array::value('subject', $params),
-    'location' => CRM_Utils_Array::value('location', $params),
-    'activity_date_time' => CRM_Utils_Array::value('start_date', $params),
-    'duration' => CRM_Utils_Array::value('duration', $params),
-    'medium_id' => CRM_Utils_Array::value('medium_id', $params),
-    'details' => CRM_Utils_Array::value('details', $params),
+    'caseID' => $params['id'] ?? NULL,
+    'subject' => $params['subject'] ?? NULL,
+    'location' => $params['location'] ?? NULL,
+    'activity_date_time' => $params['start_date'] ?? NULL,
+    'duration' => $params['duration'] ?? NULL,
+    'medium_id' => $params['medium_id'] ?? NULL,
+    'details' => $params['details'] ?? NULL,
     'custom' => [],
-    'relationship_end_date' => CRM_Utils_Array::value('end_date', $params),
+    'relationship_end_date' => $params['end_date'] ?? NULL,
   ];
 
   // Do it! :-D
index 00c0bebe1d53647f9a54134cbbdc100ae53d089c..9fd042bf3324fb56565b968f37c47a24c31a4060 100644 (file)
@@ -1592,9 +1592,9 @@ function civicrm_api3_contact_duplicatecheck($params) {
     return civicrm_api3('Contact', 'get', [
       'return' => $params['return'],
       'id' => ['IN' => $dupes],
-      'options' => CRM_Utils_Array::value('options', $params),
-      'sequential' => CRM_Utils_Array::value('sequential', $params),
-      'check_permissions' => CRM_Utils_Array::value('check_permissions', $params),
+      'options' => $params['options'] ?? NULL,
+      'sequential' => $params['sequential'] ?? NULL,
+      'check_permissions' => $params['check_permissions'] ?? NULL,
     ]);
   }
   foreach ($dupes as $dupe) {
index 8ca245cb80f99fc68cf8e2a1b5dd3d766bab9431..de3f425b76f588777161f46fde1bd5fdb691f968 100644 (file)
@@ -61,7 +61,7 @@ function civicrm_api3_domain_get($params) {
         $domain['domain_phone'] = [
           'phone_type' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_Phone', 'phone_type_id',
             CRM_Utils_Array::value('phone_type_id', $values['location']['phone'][1])),
-          'phone' => CRM_Utils_Array::value('phone', $values['location']['phone'][1]),
+          'phone' => $values['location']['phone'][1]['phone'] ?? NULL,
         ];
       }
 
index 1f12a073223bb7abac2583e88961a55dc0e5a6a4..17463bb1a3a003cd5446567da43ca658b0bc71d7 100644 (file)
@@ -515,10 +515,10 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
     $profileFields[$profileID][$fieldName] = array_merge([
       'api.required' => $field['is_required'],
       'title' => $field['label'],
-      'help_pre' => CRM_Utils_Array::value('help_pre', $field),
-      'help_post' => CRM_Utils_Array::value('help_post', $field),
+      'help_pre' => $field['help_pre'] ?? NULL,
+      'help_post' => $field['help_post'] ?? NULL,
       'entity' => $entity,
-      'weight' => CRM_Utils_Array::value('weight', $field),
+      'weight' => $field['weight'] ?? NULL,
     ], $aliasArray);
 
     $ufFieldTaleFieldName = $field['field_name'];
index 3eb6845ce4af7dac24bfc03517f31fcf16ecf764..486d67bb1b5c22873df7f4ccdb2069ec7988ab8f 100644 (file)
@@ -246,7 +246,7 @@ function civicrm_api3_system_get($params) {
         'exampleUrl' => CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE),
       ],
       'http' => [
-        'software' => CRM_Utils_Array::value('SERVER_SOFTWARE', $_SERVER),
+        'software' => $_SERVER['SERVER_SOFTWARE'] ?? NULL,
         'forwarded' => !empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['X_FORWARDED_PROTO']),
         'port' => (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? 'Standard' : 'Nonstandard',
       ],
index 0b17d88b11f3cc6a20a4b6704b425da77d727b4d..09228ba9d62bc3be2fbabf71415381c660d1b8f6 100644 (file)
@@ -386,7 +386,7 @@ function _sequentialcreditnotes_civix_insert_navigation_menu(&$menu, $path, $ite
   if (empty($path)) {
     $menu[] = [
       'attributes' => array_merge([
-        'label'      => CRM_Utils_Array::value('name', $item),
+        'label'      => $item['name'] ?? NULL,
         'active'     => 1,
       ], $item),
     ];
index 5ecedd18a8dbaaa7bf4ee89785e27b00d71ccbbb..77e6020f6a9631f512b3fe39c79b0c9d3178cffa 100644 (file)
@@ -328,7 +328,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'is_primary' => 1,
     ];
     $compareParams = [
-      'street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
+      'street_address' => $params['address'][1]['street_address'] ?? NULL,
       'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1',
         $params['address'][1]
       ),
@@ -338,14 +338,14 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3',
         $params['address'][1]
       ),
-      'city' => CRM_Utils_Array::value('city', $params['address'][1]),
-      'postal_code' => CRM_Utils_Array::value('postal_code', $params['address'][1]),
-      'country_id' => CRM_Utils_Array::value('country_id', $params['address'][1]),
+      'city' => $params['address'][1]['city'] ?? NULL,
+      'postal_code' => $params['address'][1]['postal_code'] ?? NULL,
+      'country_id' => $params['address'][1]['country_id'] ?? NULL,
       'state_province_id' => CRM_Utils_Array::value('state_province_id',
         $params['address'][1]
       ),
-      'geo_code_1' => CRM_Utils_Array::value('geo_code_1', $params['address'][1]),
-      'geo_code_2' => CRM_Utils_Array::value('geo_code_2', $params['address'][1]),
+      'geo_code_1' => $params['address'][1]['geo_code_1'] ?? NULL,
+      'geo_code_2' => $params['address'][1]['geo_code_2'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
@@ -359,8 +359,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     //Now check DB for IM
     $compareParams = [
-      'name' => CRM_Utils_Array::value('name', $params['im'][1]),
-      'provider_id' => CRM_Utils_Array::value('provider_id', $params['im'][1]),
+      'name' => $params['im'][1]['name'] ?? NULL,
+      'provider_id' => $params['im'][1]['provider_id'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
 
@@ -369,7 +369,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'contact_id' => $contactId,
       'location_type_id' => 1,
       'is_primary' => 1,
-      'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][1]),
+      'phone_type_id' => $params['phone'][1]['phone_type_id'] ?? NULL,
     ];
     $compareParams = ['phone' => CRM_Utils_Array::value('phone', $params['phone'][1])];
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
@@ -378,7 +378,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $searchParams = [
       'contact_id' => $contactId,
       'location_type_id' => 1,
-      'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+      'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
     ];
     $compareParams = ['phone' => CRM_Utils_Array::value('phone', $params['phone'][2])];
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
@@ -838,16 +838,16 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'is_primary' => 1,
     ];
     $compareParams = [
-      'street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
-      'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $profileParams),
-      'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $profileParams),
-      'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3-Primary', $profileParams),
-      'city' => CRM_Utils_Array::value('city-Primary', $profileParams),
-      'postal_code' => CRM_Utils_Array::value('postal_code-Primary', $profileParams),
-      'country_id' => CRM_Utils_Array::value('country-Primary', $profileParams),
-      'state_province_id' => CRM_Utils_Array::value('state_province-Primary', $profileParams),
-      'geo_code_1' => CRM_Utils_Array::value('geo_code_1-Primary', $profileParams),
-      'geo_code_2' => CRM_Utils_Array::value('geo_code_2-Primary', $profileParams),
+      'street_address' => $profileParams['street_address-Primary'] ?? NULL,
+      'supplemental_address_1' => $profileParams['supplemental_address_1-Primary'] ?? NULL,
+      'supplemental_address_2' => $profileParams['supplemental_address_2-Primary'] ?? NULL,
+      'supplemental_address_3' => $profileParams['supplemental_address_3-Primary'] ?? NULL,
+      'city' => $profileParams['city-Primary'] ?? NULL,
+      'postal_code' => $profileParams['postal_code-Primary'] ?? NULL,
+      'country_id' => $profileParams['country-Primary'] ?? NULL,
+      'state_province_id' => $profileParams['state_province-Primary'] ?? NULL,
+      'geo_code_1' => $profileParams['geo_code_1-Primary'] ?? NULL,
+      'geo_code_2' => $profileParams['geo_code_2-Primary'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
@@ -857,8 +857,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     //Now check DB for IM
     $compareParams = [
-      'name' => CRM_Utils_Array::value('im-Primary', $profileParams),
-      'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $profileParams),
+      'name' => $profileParams['im-Primary'] ?? NULL,
+      'provider_id' => $profileParams['im-Primary-provider_id'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
 
@@ -875,7 +875,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $searchParams = [
       'contact_id' => $contactId,
       'location_type_id' => 1,
-      'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+      'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
     ];
     $compareParams = ['phone' => CRM_Utils_Array::value('phone-Primary-2', $profileParams)];
 
@@ -1044,16 +1044,16 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'is_primary' => 1,
     ];
     $compareParams = [
-      'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
-      'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $updatePfParams),
-      'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $updatePfParams),
-      'supplemental_address_3' => CRM_Utils_Array::value('supplemental_address_3-Primary', $updatePfParams),
-      'city' => CRM_Utils_Array::value('city-Primary', $updatePfParams),
-      'postal_code' => CRM_Utils_Array::value('postal_code-Primary', $updatePfParams),
-      'country_id' => CRM_Utils_Array::value('country-Primary', $updatePfParams),
-      'state_province_id' => CRM_Utils_Array::value('state_province-Primary', $updatePfParams),
-      'geo_code_1' => CRM_Utils_Array::value('geo_code_1-Primary', $updatePfParams),
-      'geo_code_2' => CRM_Utils_Array::value('geo_code_2-Primary', $updatePfParams),
+      'street_address' => $updatePfParams['street_address-Primary'] ?? NULL,
+      'supplemental_address_1' => $updatePfParams['supplemental_address_1-Primary'] ?? NULL,
+      'supplemental_address_2' => $updatePfParams['supplemental_address_2-Primary'] ?? NULL,
+      'supplemental_address_3' => $updatePfParams['supplemental_address_3-Primary'] ?? NULL,
+      'city' => $updatePfParams['city-Primary'] ?? NULL,
+      'postal_code' => $updatePfParams['postal_code-Primary'] ?? NULL,
+      'country_id' => $updatePfParams['country-Primary'] ?? NULL,
+      'state_province_id' => $updatePfParams['state_province-Primary'] ?? NULL,
+      'geo_code_1' => $updatePfParams['geo_code_1-Primary'] ?? NULL,
+      'geo_code_2' => $updatePfParams['geo_code_2-Primary'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
@@ -1063,8 +1063,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     //Now check DB for IM
     $compareParams = [
-      'name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
-      'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $updatePfParams),
+      'name' => $updatePfParams['im-Primary'] ?? NULL,
+      'provider_id' => $updatePfParams['im-Primary-provider_id'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
 
@@ -1081,7 +1081,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $searchParams = [
       'contact_id' => $contactId,
       'location_type_id' => 1,
-      'phone_type_id' => CRM_Utils_Array::value('phone_type_id', $params['phone'][2]),
+      'phone_type_id' => $params['phone'][2]['phone_type_id'] ?? NULL,
     ];
     $compareParams = ['phone' => CRM_Utils_Array::value('phone-Primary-2', $updatePfParams)];
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
@@ -1615,7 +1615,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'is_primary' => 1,
     ];
     $compareParams = [
-      'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
+      'street_address' => $updatePfParams['street_address-Primary'] ?? NULL,
     ];
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
index 26fc750bc5ff4ccb0808e861f10f92f812c87043..f91874864abe8596de1444e8be60554712128d8a 100644 (file)
@@ -275,7 +275,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
 
     //Now check DB for location elements.
     $searchParams = [
-      'id' => CRM_Utils_Array::value('address_id', $locElementIds),
+      'id' => $locElementIds['address_id'] ?? NULL,
       'location_type_id' => 1,
       'is_primary' => 1,
     ];
@@ -294,7 +294,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
     $searchParams = [
-      'id' => CRM_Utils_Array::value('email_id', $locElementIds),
+      'id' => $locElementIds['email_id'] ?? NULL,
       'location_type_id' => 1,
       'is_primary' => 1,
     ];
@@ -302,7 +302,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams);
 
     $searchParams = [
-      'id' => CRM_Utils_Array::value('phone_id', $locElementIds),
+      'id' => $locElementIds['phone_id'] ?? NULL,
       'location_type_id' => 1,
       'is_primary' => 1,
       'phone_type_id' => 1,
@@ -311,7 +311,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
 
     $searchParams = [
-      'id' => CRM_Utils_Array::value('phone_2_id', $locElementIds),
+      'id' => $locElementIds['phone_2_id'] ?? NULL,
       'location_type_id' => 1,
       'phone_type_id' => 2,
     ];
@@ -319,7 +319,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
 
     $searchParams = [
-      'id' => CRM_Utils_Array::value('im_id', $locElementIds),
+      'id' => $locElementIds['im_id'] ?? NULL,
       'location_type_id' => 1,
       'is_primary' => 1,
     ];
index 69dee259d3dc1d6980562ad452e388133fff82af..fcb5d572b075a98fdcd74357c9744d91c061923a 100644 (file)
@@ -256,7 +256,7 @@ function _angularex_civix_insert_navigation_menu(&$menu, $path, $item, $parentId
     $navId++;
     $menu[$navId] = [
       'attributes' => array_merge($item, [
-        'label' => CRM_Utils_Array::value('name', $item),
+        'label' => $item['name'] ?? NULL,
         'active' => 1,
         'parentID' => $parentId,
         'navID' => $navId,