From ad64fa72ff399ef091e58bcf4676ae8636778ac7 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 18 May 2020 18:56:39 +1200 Subject: [PATCH] [REF] Stop passing by reference. By checking in BAOContribution::loadRelatedObjects we can see it is not modified. The other 2 functions only pass input to that function, so can also be non-variables --- CRM/Contribute/BAO/Contribution.php | 2 +- CRM/Core/Payment/BaseIPN.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 48b01b3e6c..f94cb0a780 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2755,7 +2755,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac * @return bool * @throws Exception */ - public function loadRelatedObjects(&$input, &$ids, $loadAll = FALSE) { + public function loadRelatedObjects($input, &$ids, $loadAll = FALSE) { // @todo deprecate this function - the steps should be // 1) add additional functions like 'getRelatedMemberships' // 2) switch all calls that refer to ->_relatedObjects to diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 2da96d6cc4..2ad490ac4d 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -85,7 +85,7 @@ class CRM_Core_Payment_BaseIPN { * * @return bool */ - public function validateData(&$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) { + public function validateData($input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) { // Check if the contribution exists // make sure contribution exists and is valid @@ -158,7 +158,7 @@ class CRM_Core_Payment_BaseIPN { * * @return bool|array */ - public function loadObjects(&$input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) { + public function loadObjects($input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) { if (empty($error_handling)) { // default options are that we log an error & echo it out // note that we should refactor this error handling into error code @ some point -- 2.25.1