Update a few references to list()
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 7 Apr 2023 03:41:52 +0000 (15:41 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 7 Apr 2023 03:46:34 +0000 (15:46 +1200)
CRM/Activity/Controller/Search.php
CRM/Activity/Form/Activity.php
CRM/Activity/Form/ActivityLinks.php
CRM/Activity/Form/ActivityView.php
CRM/Activity/Form/Task/AddToTag.php
CRM/Activity/Form/Task/RemoveFromTag.php
CRM/Activity/Selector/Search.php
CRM/Activity/StateMachine/Search.php
CRM/Activity/Task.php
CRM/Contact/Form/Search/Criteria.php
tests/phpunit/CRMTraits/PCP/PCPTestTrait.php

index e4938d0187a11b5ece5707074418680e9611a357..6e58265b079fad7a650460f9527af67312577c53 100644 (file)
@@ -28,6 +28,9 @@
  */
 class CRM_Activity_Controller_Search extends CRM_Core_Controller {
 
+  /**
+   * @var string
+   */
   protected $entity = 'Activity';
 
   /**
index 849264a1772eebd95a387ee2821c0233eb4070c6..001ea75742a96ce0ff2f648c69e0e9a8cfc9665d 100644 (file)
@@ -373,7 +373,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
 
     $activityTypeDescription = NULL;
     if ($this->_activityTypeId) {
-      list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
+      [$this->_activityTypeName, $activityTypeDescription] = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
     }
 
     // Set activity type name and description to template.
index 6f2f61aa3a7419962dbc3666eb14468633e96234..238758614a1f01b0af880d0f39846bef489ce5c7 100644 (file)
@@ -44,11 +44,11 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form {
 
     foreach ($allTypes as $act) {
       $url = 'civicrm/activity/add';
-      if ($act['name'] == 'Email') {
+      if ($act['name'] === 'Email') {
         if (!CRM_Utils_Mail::validOutBoundMail() || !$contactId) {
           continue;
         }
-        list($name, $email, $doNotEmail, $onHold, $isDeceased) = CRM_Contact_BAO_Contact::getContactDetails($contactId);
+        [, $email, $doNotEmail, , $isDeceased] = CRM_Contact_BAO_Contact::getContactDetails($contactId);
         if (!$doNotEmail && $email && !$isDeceased) {
           $url = 'civicrm/activity/email/add';
           $act['label'] = ts('Send an Email');
@@ -57,7 +57,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form {
           continue;
         }
       }
-      elseif ($act['name'] == 'SMS') {
+      elseif ($act['name'] === 'SMS') {
         if (!$contactId || !CRM_SMS_BAO_Provider::activeProviderCount() || !CRM_Core_Permission::check('send SMS')) {
           continue;
         }
index 6ff714c92b8f1a9413d84212774e74b95329f364..31223e18f980475bbc8ae8ab6d1a25a6c03068a2 100644 (file)
@@ -60,7 +60,7 @@ class CRM_Activity_Form_ActivityView extends CRM_Core_Form {
     CRM_Activity_BAO_Activity::retrieve($params, $defaults);
 
     // Send activity type description to template.
-    list(, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
+    [, $activityTypeDescription] = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
     $this->assign('activityTypeDescription', $activityTypeDescription);
 
     if (!empty($defaults['mailingId'])) {
index d3fa1d0e10320adaf86198f45a3a7186b3498b28..b8ed25a2fe67bc6a85a75bd827c84950c522f704 100644 (file)
@@ -123,7 +123,7 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task {
     foreach ($allTags as $key => $dnc) {
       $this->_name[] = $this->_tags[$key];
 
-      list($total, $added, $notAdded) = CRM_Core_BAO_EntityTag::addEntitiesToTag($this->_activityHolderIds, $key,
+      [, $added, $notAdded] = CRM_Core_BAO_EntityTag::addEntitiesToTag($this->_activityHolderIds, $key,
         'civicrm_activity', FALSE);
 
       $status = [ts('Activity tagged', ['count' => $added, 'plural' => '%count activities tagged'])];
index db26fa0a2007d2f3e969ff1b786b0d29877aaac3..1f7fc04f25120b7c81d039b100f2e2332d11262d 100644 (file)
@@ -95,7 +95,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task {
             $tagList[$val] = 1;
           }
           else {
-            list($label, $tagID) = explode(',', $val);
+            [, $tagID] = explode(',', $val);
             $tagList[$tagID] = 1;
           }
         }
@@ -113,7 +113,7 @@ class CRM_Activity_Form_Task_RemoveFromTag extends CRM_Activity_Form_Task {
     foreach ($allTags as $key => $dnc) {
       $this->_name[] = $this->_tags[$key];
 
-      list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_activityHolderIds,
+      [, $removed, $notRemoved] = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_activityHolderIds,
         $key, 'civicrm_activity', FALSE);
 
       $status = [
index 3e73fc285585f128a99969daeef1b6a6b6aeb6ff..8a042754288a2cc60c2a7907b771a4e7e64e16ac 100644 (file)
@@ -261,7 +261,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
 
       $row['target_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $targetID);
       $row['assignee_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $assigneeID);
-      list($row['source_contact_name'], $row['source_contact_id']) = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $sourceID, TRUE);
+      [$row['source_contact_name'], $row['source_contact_id']] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $sourceID, TRUE);
       $row['source_contact_name'] = implode(',', array_values($row['source_contact_name']));
       $row['source_contact_id'] = implode(',', $row['source_contact_id']);
 
index 28a3c8815b01e732c27e4a86d1d9bc502179a52b..6e08eb9861fdcd2f9cff7bf0bc4724b39e1fe995 100644 (file)
@@ -35,7 +35,7 @@ class CRM_Activity_StateMachine_Search extends CRM_Core_StateMachine {
     $this->_pages = [];
 
     $this->_pages['CRM_Activity_Form_Search'] = NULL;
-    list($task) = $this->taskName($controller, 'Search');
+    [$task] = $this->taskName($controller, 'Search');
     $this->_task = $task;
     foreach ($task as $t) {
       $this->_pages[$t] = NULL;
index c362893d572fe5735ee93745bf8ffd954ffc00ec..ba30cbe8cec924cdef2feae0aa31a68e5c480425 100644 (file)
@@ -19,6 +19,9 @@
  */
 class CRM_Activity_Task extends CRM_Core_Task {
 
+  /**
+   * @var string
+   */
   public static $objectType = 'activity';
 
   /**
index 18fd41cd0d82fe05fd0675898e4f2badb475b139..ac6b938203775b36aa90e833a7be0af9781d5322 100644 (file)
@@ -427,7 +427,7 @@ class CRM_Contact_Form_Search_Criteria {
     $parseStreetAddress = $addressOptions['street_address_parsing'] ?? 0;
     $form->assign('parseStreetAddress', $parseStreetAddress);
     foreach ($elements as $name => $v) {
-      list($title, $attributes, $select, $multiSelect) = $v;
+      [$title, $attributes, $select, $multiSelect] = $v;
 
       if (in_array($name,
         ['street_number', 'street_name', 'street_unit']
index 20558b3a563c0ff8d0978b395197e1543dac1b54..85f93fcd9ab8b4f98fb199ace1848505fbbb7ad4 100644 (file)
@@ -24,7 +24,6 @@ trait CRMTraits_PCP_PCPTestTrait {
    *
    * Create the necessary initial objects for a pcpBlock, then return the
    * params needed to create the pcpBlock.
-   *
    */
   public function pcpBlockParams() {
     $contribPage = CRM_Core_DAO::createTestObject('CRM_Contribute_DAO_ContributionPage');