Reduce use of reference
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 11 Apr 2022 19:53:08 +0000 (07:53 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 11 Apr 2022 19:53:08 +0000 (07:53 +1200)
Reference does not make sense for objects. assign_by_ref does not make
sense when not used again in the function or returned in a reffy kinda way

CRM/Core/BAO/CustomGroup.php

index 098804848155b48ad2e76f6b5f14e8ebbe59b365..1dfa5697e05b851d438110243a57b2c6250da4cd 100644 (file)
@@ -1896,7 +1896,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1,
    * @return array|int
    * @throws \CRM_Core_Exception
    */
-  public static function buildCustomDataView(&$form, $groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL, $entityId = NULL, $checkEditPermission = FALSE) {
+  public static function buildCustomDataView($form, $groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL, $entityId = NULL, $checkEditPermission = FALSE) {
     // Filter out pesky extra info
     unset($groupTree['info']);
 
@@ -1988,7 +1988,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1,
         'groupId',
         'skipTitle',
       ]);
-      $form->assign_by_ref("{$prefix}viewCustomData", $details);
+      $form->assign("{$prefix}viewCustomData", $details);
       return $details;
     }
   }