From e06814a5d5e45dc4b425e4e6d7f55e7317a5d588 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 7 Oct 2018 11:54:25 +0100 Subject: [PATCH] [NFC] Minor cleanup, return preferred parameter The result parameter is the same as $recurring (save()) returns $this. But it's more correct to return $recurring than result as a) it's defined as a Contribute_BAO_ContributionRecur object which is correct. b) it's the object passed through hooks --- CRM/Contribute/BAO/ContributionRecur.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index a5c76722c4..89ed90f7a6 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -96,7 +96,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi $config = CRM_Core_Config::singleton(); $recurring->currency = $config->defaultCurrency; } - $result = $recurring->save(); + $recurring->save(); if (!empty($params['id'])) { CRM_Utils_Hook::post('edit', 'ContributionRecur', $recurring->id, $recurring); @@ -111,7 +111,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_contribution_recur', $recurring->id); } - return $result; + return $recurring; } /** -- 2.25.1