CRM/Mailing - Refactor unnecessary uses of CRM_Utils_Array::value
authorcolemanw <coleman@civicrm.org>
Fri, 13 Oct 2023 23:44:50 +0000 (19:44 -0400)
committercolemanw <coleman@civicrm.org>
Sat, 14 Oct 2023 03:27:42 +0000 (23:27 -0400)
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingJob.php

index f63ef91ff07e3e87ff81ef7e7d932fe146b1c53a..5270a8a666fc4f4a35c8bd924eaa4823faead562 100644 (file)
@@ -2863,7 +2863,7 @@ ORDER BY civicrm_mailing.id DESC";
       $mailing['openstats'] = "Opens: " .
         CRM_Utils_Array::value($values['mailing_id'], $openCounts, 0) .
         "<br />Clicks: " .
-        CRM_Utils_Array::value($values['mailing_id'], $clickCounts, 0);
+        $clickCounts[$values['mailing_id']] ?? 0;
 
       $actionLinks = [
         CRM_Core_Action::VIEW => [
index ed18b5ca3710b5e5b77f5785320384b8044e84f5..3d7598007937f2b45c7c4d0fc5d550fde5ce54e2 100644 (file)
@@ -45,7 +45,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
       throw new CRM_Core_Exception("Failed to create job: Unknown mailing ID");
     }
     $op = empty($params['id']) ? 'create' : 'edit';
-    CRM_Utils_Hook::pre($op, 'MailingJob', CRM_Utils_Array::value('id', $params), $params);
+    CRM_Utils_Hook::pre($op, 'MailingJob', $params['id'] ?? NULL, $params);
 
     $jobDAO = new CRM_Mailing_BAO_MailingJob();
     $jobDAO->copyValues($params);