Merge pull request #16759 from eileenmcnaughton/fatal2
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 13 Mar 2020 07:37:44 +0000 (18:37 +1100)
committerGitHub <noreply@github.com>
Fri, 13 Mar 2020 07:37:44 +0000 (18:37 +1100)
Remove instances of fatal

100 files changed:
CRM/Activity/BAO/Activity.php
CRM/Activity/BAO/ActivityType.php
CRM/Activity/Form/ActivityView.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/BAO/ManagePremiums.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/File.php
CRM/Core/BAO/FinancialTrxn.php
CRM/Core/BAO/Note.php
CRM/Core/BAO/OptionValue.php
CRM/Core/BAO/Tag.php
CRM/Core/BAO/UFGroup.php
CRM/Core/DAO/Discount.php
CRM/Core/DAO/OpenID.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/BAO/ParticipantPayment.php
CRM/Event/Cart/BAO/MerParticipant.php
CRM/Event/Cart/Form/Cart.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/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingComponent.php
CRM/Member/BAO/Membership.php
CRM/Member/BAO/MembershipStatus.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/Price/BAO/PriceFieldValue.php
CRM/Report/Form.php
CRM/Report/Form/Case/Detail.php
CRM/Utils/Address.php
CRM/Utils/Cache.php
CRM/Utils/Chart.php
CRM/Utils/Check/Component/Env.php
CRM/Utils/Date.php
CRM/Utils/DeprecatedUtils.php
CRM/Utils/Migrate/ExportJSON.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
tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php
tools/extensions/org.civicrm.angularex/angularex.civix.php
tools/scripts/solr/createSyncJSON.php
xml/schema/Core/Discount.xml
xml/schema/Core/OpenID.xml

index 3687df1b17337bf0c00a0b877862801f95226fa9..06f0e91b62bd0c745d4319de584f59f796367ab2 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),
-        '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),
+        'activity_date_time' => $activity['activity_date_time'] ?? NULL,
+        'subject' => $activity['subject'] ?? NULL,
+        'assignee_contact_name' => $activity['assignee_contact_sort_name'] ?? [],
+        '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 3ef07b7aa1428a597492e6ee66b967a413fda976..e3df30c80a04f022ec5e9bf84d0933cd74710fa7 100644 (file)
@@ -54,12 +54,8 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
     $params = ['id' => $activityId];
     CRM_Activity_BAO_Activity::retrieve($params, $defaults);
 
-    // Set activity type name and description to template.
-    list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
-
-    // activityTypeName - dev/core#1116-unknown-if-ok
-    // It seems like activityTypeName is no longer used? Description is still used though. See PR notes for more details.
-    $this->assign('activityTypeName', $activityTypeName);
+    // Send activity type description to template.
+    list(, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
     $this->assign('activityTypeDescription', $activityTypeDescription);
 
     if (!empty($defaults['mailingId'])) {
index c193d251d8c1dbfda08f2fee579aa4667c06b11c..4f7516d8d11d14c43e1fc47f9cb7dacd06930c48 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),
-      '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),
+      'name' => $formValues['name'] ?? NULL,
+      'label' => $formValues['label'] ?? NULL,
+      'class' => $formValues['class'] ?? NULL,
+      'is_active' => $formValues['is_active'] ?? FALSE,
+      'is_counted' => $formValues['is_counted'] ?? FALSE,
+      '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 130dbfc63b3d5afeb4dbfd9b2b282687635dcf1a..50eb6d391462e0b71ad47a14b4e9203da976d463 100644 (file)
@@ -354,7 +354,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);
@@ -371,7 +371,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);
@@ -748,7 +748,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,
@@ -3189,7 +3189,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;
@@ -3199,9 +3199,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'],
         ];
       }
@@ -3216,10 +3216,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..fff3ef2c8c704c45739f555829717afd76fbfb39 100644 (file)
@@ -910,9 +910,9 @@ 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),
-        'is_deceased' => CRM_Utils_Array::value('is_deceased', $params, FALSE),
-        'deceased_date' => CRM_Utils_Array::value('deceased_date', $params, NULL),
+        'contact_id' => $params['contact_id'] ?? NULL,
+        'is_deceased' => $params['is_deceased'] ?? FALSE,
+        'deceased_date' => $params['deceased_date'] ?? NULL,
       ];
       $updateMembershipMsg = CRM_Member_BAO_Membership::updateMembershipStatus($deceasedParams, $this->_contactType);
     }
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 e7d986678ae814ceee1e3a3204e469e197cda105..272222804d006ccb565fa3935876428b8076675b 100644 (file)
@@ -70,7 +70,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_BAO_Product {
    */
   public static function add(&$params, $ids) {
     CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::create');
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('premium', $ids));
+    $id = $params['id'] ?? $ids['premium'] ?? NULL;
     if ($id) {
       $params['id'] = $id;
     }
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 207f02ea6c5532e31909d066d65874368a501dc7..0d34aaaf00298648319c13501cbf889387580fad 100644 (file)
@@ -565,7 +565,7 @@ AND       CEF.entity_id    = %2";
         $extraParams = [
           'description' => $formValues[$attachDesc],
           'tag' => $tagParams,
-          'attachment_taglist' => CRM_Utils_Array::value($attachFreeTags, $formValues, []),
+          'attachment_taglist' => $formValues[$attachFreeTags] ?? [],
         ];
 
         CRM_Utils_File::formatFile($formValues, $attachName, $extraParams);
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 2930a653181518f247eeaa8a7971f3314fcdbbd7..86a95fd0800a7ae8ee9303afe0d314a66a6ca18a 100644 (file)
@@ -150,7 +150,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
         $note->contact_id = $params['entity_id'];
       }
     }
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids));
+    $id = $params['id'] ?? $ids['id'] ?? NULL;
     if ($id) {
       $note->id = $id;
     }
index 2aefe0e14cdadaebe36ade14ce4027df3a93adf1..4da2ece077499f1c44ca73fb275456c10f7f1c77 100644 (file)
@@ -154,7 +154,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
    * @throws \CRM_Core_Exception
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('optionValue', $ids));
+    $id = $params['id'] ?? $ids['optionValue'] ?? NULL;
     // CRM-10921: do not reset attributes to default if this is an update
     //@todo consider if defaults are being set in the right place. 'dumb' defaults like
     // these would be usefully set @ the api layer so they are visible to api users
index 57623f1d727b84d5a29f864395d058bfe7d372e4..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;
@@ -393,7 +393,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
    *   object on success, otherwise null
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('tag', $ids));
+    $id = $params['id'] ?? $ids['tag'] ?? NULL;
     if (!$id && !self::dataExists($params)) {
       return NULL;
     }
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 416cfc99038ed08fae83fb605d43846288c297ae..26a7419da2d24cf099ad826fcee73483c8a29c66 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Discount.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:65e21ec2893577e8026e3194864cdad3)
+ * (GenCodeChecksum:856b526f1fe395e4460ebf886a258d4f)
  */
 
 /**
@@ -152,6 +152,11 @@ class CRM_Core_DAO_Discount extends CRM_Core_DAO {
           'bao' => 'CRM_Core_BAO_Discount',
           'localizable' => 0,
           'FKClassName' => 'CRM_Price_DAO_PriceSet',
+          'pseudoconstant' => [
+            'table' => 'civicrm_price_set',
+            'keyColumn' => 'id',
+            'labelColumn' => 'title',
+          ],
         ],
         'start_date' => [
           'name' => 'start_date',
index 56fc736a9c62c1230afa5614a8545e1df3e3e8b2..fcce8503fbb8e764d42df216d358f189223884b3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/OpenID.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4baa608e9caa3e118ac02d28032b8bc2)
+ * (GenCodeChecksum:2afae5cc76cd5df22b314276138fc122)
  */
 
 /**
@@ -135,6 +135,11 @@ class CRM_Core_DAO_OpenID extends CRM_Core_DAO {
           'entity' => 'OpenID',
           'bao' => 'CRM_Core_BAO_OpenID',
           'localizable' => 0,
+          'pseudoconstant' => [
+            'table' => 'civicrm_location_type',
+            'keyColumn' => 'id',
+            'labelColumn' => 'display_name',
+          ],
         ],
         'openid' => [
           'name' => 'openid',
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..773194a1aea18b813263dde562589ad314870bc2 100644 (file)
@@ -232,9 +232,9 @@ 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),
+        'condition' => $pseudoconstant['condition'] ?? [],
+        '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 401fcd09dad809022c0e6a07b973fb7868163aad..106b2bbae3446b11c30da981080cca1c5302362c 100644 (file)
@@ -31,7 +31,7 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment
    *   the partcipant payment record
    */
   public static function create(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids));
+    $id = $params['id'] ?? $ids['id'] ?? NULL;
     if ($id) {
       CRM_Utils_Hook::pre('edit', 'ParticipantPayment', $id, $params);
     }
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 3b7bee6931efb6cd152af277953f8627a5834111..048c2ba5b9cccc231e0c3b0c78c204e9aa43bc2e 100644 (file)
@@ -139,9 +139,9 @@ class CRM_Event_Cart_Form_Cart extends CRM_Core_Form {
       return $contact_id;
     }
     $contact_params = [
-      'email-Primary' => CRM_Utils_Array::value('email', $fields, NULL),
-      'first_name' => CRM_Utils_Array::value('first_name', $fields, NULL),
-      'last_name' => CRM_Utils_Array::value('last_name', $fields, NULL),
+      'email-Primary' => $fields['email'] ?? NULL,
+      'first_name' => $fields['first_name'] ?? NULL,
+      'last_name' => $fields['last_name'] ?? NULL,
       'is_deleted' => CRM_Utils_Array::value('is_deleted', $fields, TRUE),
     ];
     $no_fields = [];
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..6dc21ffd9924e616a962ed25c60a32f3cfa06a30 100644 (file)
@@ -259,10 +259,10 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
     }
     if (empty($errors) && empty($contact_id)) {
       $params = [
-        'email-Primary' => CRM_Utils_Array::value('email', $fields, NULL),
-        'first_name' => CRM_Utils_Array::value('first_name', $fields, NULL),
-        'last_name' => CRM_Utils_Array::value('last_name', $fields, NULL),
-        'is_deleted' => CRM_Utils_Array::value('is_deleted', $fields, FALSE),
+        'email-Primary' => $fields['email'] ?? NULL,
+        'first_name' => $fields['first_name'] ?? NULL,
+        'last_name' => $fields['last_name'] ?? NULL,
+        'is_deleted' => $fields['is_deleted'] ?? FALSE,
       ];
       //create new contact for this name/email pair
       //if new contact, no need to check for contact already registered
@@ -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 8af7f776c0d210ae6178151f64fdb81d5e44e828..57fca1a971a32377e96fc19cae34ac1ed47e214d 100644 (file)
@@ -1442,7 +1442,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    * @return CRM_Mailing_DAO_Mailing
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('mailing_id', $ids));
+    $id = $params['id'] ?? $ids['mailing_id'] ?? NULL;
 
     if (empty($params['id']) && !empty($ids)) {
       \Civi::log('Parameter $ids is no longer used by Mailing::add. Use the api or just pass $params', ['civi.tag' => 'deprecated']);
index 335370b61eecfda6f6cf370953f18d0719513847..006bb3aec8526556851ec0b6decfdf0d7634b546 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Mailing_BAO_MailingComponent extends CRM_Mailing_DAO_MailingComponent
    * @return CRM_Mailing_BAO_MailingComponent
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids));
+    $id = $params['id'] ?? $ids['id'] ?? NULL;
     $component = new CRM_Mailing_BAO_MailingComponent();
     if ($id) {
       $component->id = $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 d283926613641589456efeee7b276a3a63fa1aec..fc187f186b6d4490425a1bf7d0ce8ff52462e13e 100644 (file)
@@ -105,7 +105,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
    * @return object
    */
   public static function add(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('membershipStatus', $ids));
+    $id = $params['id'] ?? $ids['membershipStatus'] ?? NULL;
     if (!$id) {
       CRM_Core_DAO::setCreateDefaults($params, self::getDefaults());
       //copy name to label when not passed.
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 c3728227d1d8b0a7dbfea0f02c170fddcc2469b2..a8cfdb9eff060b3b99fefac189bb96de0bd13779 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue {
    * @throws \CRM_Core_Exception
    */
   public static function create(&$params, $ids = []) {
-    $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids));
+    $id = $params['id'] ?? $ids['id'] ?? NULL;
     if (!is_array($params) || empty($params)) {
       return NULL;
     }
@@ -157,7 +157,7 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue {
    *
    */
   public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE, $admin = FALSE) {
-    $sql = "SELECT cs.id FROM civicrm_price_set cs INNER JOIN civicrm_price_field cp ON cp.price_set_id = cs.id 
+    $sql = "SELECT cs.id FROM civicrm_price_set cs INNER JOIN civicrm_price_field cp ON cp.price_set_id = cs.id
               WHERE cs.name IN ('default_contribution_amount', 'default_membership_type_amount') AND cp.id = {$fieldId} ";
     $setId = CRM_Core_DAO::singleValueQuery($sql);
     $fieldValueDAO = new CRM_Price_DAO_PriceFieldValue();
index 47adf78eed1b64a28ccf515bca0fe5131f50c409..cf099a3debbe6a3adb9096e564e951312fa76019 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),
               ];
             }
@@ -4411,7 +4411,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
         'fields' => [
           'address_name' => [
             'title' => ts('Address Name'),
-            'default' => CRM_Utils_Array::value('name', $defaults, FALSE),
+            'default' => $defaults['name'] ?? FALSE,
             'name' => 'name',
           ],
         ],
@@ -4421,7 +4421,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
     foreach ($defaultAddressFields as $fieldName => $fieldLabel) {
       $addressFields['civicrm_address']['fields'][$fieldName] = [
         'title' => $fieldLabel,
-        'default' => CRM_Utils_Array::value($fieldName, $defaults, FALSE),
+        'default' => $defaults[$fieldName] ?? FALSE,
       ];
     }
 
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 3ac1130ce9438601ef17441ce6f0069089c11db2..6243a72bf3d89e446c669a9d2aada9e6d9e47afa 100644 (file)
@@ -190,7 +190,7 @@ class CRM_Utils_Cache {
           if (defined('CIVICRM_DSN') && CIVICRM_DSN) {
             return new CRM_Utils_Cache_SqlGroup([
               'group' => $params['name'],
-              'prefetch' => CRM_Utils_Array::value('prefetch', $params, FALSE),
+              'prefetch' => $params['prefetch'] ?? FALSE,
             ]);
           }
           break;
index 88a075085e020922f4d72b5603e6afe8a1991fa4..c8745fa0a5f0b745c958bbacea851f0311e43480 100644 (file)
@@ -200,7 +200,7 @@ class CRM_Utils_Chart {
         'legend' => "$legend " . CRM_Utils_Array::value('legend', $rows, ts('Contribution')) . ' ' . ts('Summary'),
         'values' => $graph[0],
         'multiValues' => $graph,
-        'barKeys' => CRM_Utils_Array::value('barKeys', $rows, []),
+        'barKeys' => $rows['barKeys'] ?? [],
       ];
     }
 
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 72550171c665752ed7b81e6662da0fc85d1130ec..a472aa44e65ab49ae1cf1c49b711f5ef380b639e 100644 (file)
@@ -523,7 +523,7 @@ WHERE ac.contact_id IN ( $ids )
         $_fieldsRetrieved[$daoName][$value['name']] = [
           'uniqueName' => $key,
           'type' => $value['type'],
-          'title' => CRM_Utils_Array::value('title', $value, NULL),
+          'title' => $value['title'] ?? NULL,
         ];
       }
     }
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..59818c0b0161810545c107cf6937bfc61505a124 100644 (file)
@@ -119,11 +119,11 @@ class CRM_Utils_Recent {
         'type' => $type,
         'contact_id' => $contactId,
         'contactName' => $contactName,
-        'subtype' => CRM_Utils_Array::value('subtype', $others),
-        '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),
+        'subtype' => $others['subtype'] ?? NULL,
+        'isDeleted' => $others['isDeleted'] ?? FALSE,
+        '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 2cdce1e80616751f51458de2f39636b14364dbf3..7bafb80f675105ee07a3a5b1f8eb916c9eb7dda9 100644 (file)
@@ -58,44 +58,52 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    */
   protected $mut;
 
+  /**
+   * @var int
+   */
+  private $financialTypeID;
+
   /**
    * Test setup for every test.
    *
    * Connect to the database, truncate the tables that will be used
    * and redirect stdin to a temporary file.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function setUp() {
     parent::setUp();
 
     $this->_individualId = $this->individualCreate();
     $this->_paymentProcessorID = $this->processorCreate();
+    $this->financialTypeID = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'financial_type_id', 'Member Dues');
 
     $this->loadXMLDataSet(dirname(__FILE__) . '/dataset/data.xml');
-    $membershipTypeAnnualFixed = $this->callAPISuccess('membership_type', 'create', [
+    $this->membershipTypeAnnualFixedID = $this->callAPISuccess('membership_type', 'create', [
       'domain_id' => 1,
-      'name' => "AnnualFixed",
+      'name' => 'AnnualFixed',
       'member_of_contact_id' => 23,
-      'duration_unit' => "year",
+      'duration_unit' => 'year',
       'duration_interval' => 1,
-      'period_type' => "fixed",
-      'fixed_period_start_day' => "101",
-      'fixed_period_rollover_day' => "1231",
+      'period_type' => 'fixed',
+      'fixed_period_start_day' => '101',
+      'fixed_period_rollover_day' => '1231',
       'relationship_type_id' => 20,
-      'financial_type_id' => 2,
-    ]);
-    $this->membershipTypeAnnualFixedID = $membershipTypeAnnualFixed['id'];
-    $membership = $this->callAPISuccess('Membership', 'create', [
+      'financial_type_id' => $this->financialTypeID,
+    ])['id'];
+
+    $this->_membershipID = $this->callAPISuccess('Membership', 'create', [
       'contact_id' => $this->_individualId,
       'membership_type_id' => $this->membershipTypeAnnualFixedID,
-    ]);
-    $this->_membershipID = $membership['id'];
+    ])['id'];
 
-    $instruments = $this->callAPISuccess('contribution', 'getoptions', ['field' => 'payment_instrument_id']);
-    $this->paymentInstruments = $instruments['values'];
+    $this->paymentInstruments = $this->callAPISuccess('Contribution', 'getoptions', ['field' => 'payment_instrument_id'])['values'];
   }
 
   /**
    * Clean up after each test.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function tearDown() {
     $this->validateAllPayments();
@@ -118,6 +126,9 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
 
   /**
    * Test the submit function of the membership form.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmit() {
     $form = $this->getForm();
@@ -196,6 +207,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    * Test the submit function of the membership form.
    *
    * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitRecur() {
     $form = $this->getForm();
@@ -289,6 +301,9 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
 
   /**
    * Test the submit function of the membership form.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitRecurCompleteInstant() {
     $form = $this->getForm();
@@ -400,6 +415,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    * Test the submit function of the membership form.
    *
    * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitPayLater() {
     $form = $this->getForm(NULL);
@@ -437,7 +453,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
     $contribution = $this->callAPISuccessGetSingle('Contribution', [
       'contact_id' => $this->_individualId,
       'contribution_status_id' => 2,
-      'return' => ["tax_amount", "trxn_id"],
+      'return' => ['tax_amount', 'trxn_id'],
     ]);
     $this->assertEquals($contribution['trxn_id'], 777);
     $this->assertEquals($contribution['tax_amount'], NULL);
@@ -453,6 +469,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    * Test the submit function of the membership form.
    *
    * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitPayLaterWithBilling() {
     $form = $this->getForm(NULL);
@@ -514,6 +531,9 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
 
   /**
    * Test the submit function of the membership form.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   public function testSubmitComplete() {
     $form = $this->getForm(NULL);
@@ -572,6 +592,9 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    * @param string $mode
    *
    * @return \CRM_Member_Form_MembershipRenewal
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   protected function getForm($mode = 'test') {
     $form = new CRM_Member_Form_MembershipRenewal();
@@ -590,7 +613,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
    * @return array
    */
   protected function getBaseSubmitParams() {
-    $params = [
+    return [
       'cid' => $this->_individualId,
       'price_set_id' => 0,
       'join_date' => date('m/d/Y', time()),
@@ -627,7 +650,6 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase {
       'billing_postal_code-5' => '90210',
       'billing_country_id-5' => '1228',
     ];
-    return $params;
   }
 
 }
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,
index e33ead5976f2cf6a66fc5c86ff1157470b671736..cb7c6172c98648a262f0f6b1d52c24dcb90d41fc 100644 (file)
@@ -475,7 +475,7 @@ function getDBFields($daoName) {
       $_fieldsRetrieved[$daoName][$value['name']] = [
         'uniqueName' => $key,
         'type' => $value['type'],
-        'title' => CRM_Utils_Array::value('title', $value, NULL),
+        'title' => $value['title'] ?? NULL,
       ];
     }
   }
index 16cde71afdcae8c20be8999cfcdb4b715aa0382c..4dabdfcf85360bc34250dfa032618bc929092157 100644 (file)
     <title>Discount Name</title>
     <type>int unsigned</type>
     <required>true</required>
+    <pseudoconstant>
+      <table>civicrm_price_set</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
     <export>true</export>
     <comment>FK to civicrm_price_set</comment>
     <add>4.3</add>
index 1aa5c579f679cd7c54228f5f8f7ba4e212d7fe3d..876aeca4b0c5c4301f02396ec4e193509e4cef65 100644 (file)
     <name>location_type_id</name>
     <title>OpenID Location Type</title>
     <type>int unsigned</type>
+    <pseudoconstant>
+      <table>civicrm_location_type</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>display_name</labelColumn>
+    </pseudoconstant>
     <comment>Which Location does this email belong to.</comment>
     <add>2.0</add>
   </field>