Make unshared getTree function private, remove never passed params
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 7 Feb 2023 01:36:05 +0000 (14:36 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 7 Feb 2023 01:36:07 +0000 (14:36 +1300)
This function is a recent split from a complex function. It is called
from 2 places, within this file so this
1) makes it private
2) removes never-passed parameters
https://github.com/civicrm/civicrm-core/commit/1090db413680855d449671b841af8185f0baeb1f#diff-fe60c89ebe94bbd40114d135459371cc53708db1f2952ade6c0ce9b3468c4dabR1720

CRM/Dedupe/Merger.php

index 85f5b2a0bcc39b3f2569979146e8321ca8896919..29e144a0e3943588efa729321aa5739fdf4b35b6 100644 (file)
@@ -1699,9 +1699,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   api - through which it is properly tested - so can be refactored with some comfort.)
    * @param bool|int $checkPermission
    *   Either a CRM_Core_Permission constant or FALSE to disable checks
-   * @param string|int $singleRecord
-   *   holds 'new' or id if view/edit/copy form for a single record is being loaded.
-   * @param bool $showPublicOnly
    *
    * @return array
    *   Custom field 'tree'.
@@ -1717,7 +1714,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *
    * @throws \CRM_Core_Exception
    */
-  public static function getTree(
+  private static function getTree(
     $entityType,
     $toReturn = [],
     $entityID = NULL,
@@ -1727,10 +1724,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
     $fromCache = TRUE,
     $onlySubType = NULL,
     $returnAll = FALSE,
-    $checkPermission = CRM_Core_Permission::EDIT,
-    $singleRecord = NULL,
-    $showPublicOnly = FALSE
+    $checkPermission = CRM_Core_Permission::EDIT
   ) {
+    $singleRecord = NULL;
+    $showPublicOnly = FALSE;
     if ($checkPermission === TRUE) {
       CRM_Core_Error::deprecatedWarning('Unexpected TRUE passed to CustomGroup::getTree $checkPermission param.');
       $checkPermission = CRM_Core_Permission::EDIT;