Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Remove pass-by-reference & always empty param #17984

Merged
merged 1 commit into from
Aug 1, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 28, 2020

Overview

Removes unused param, unnecessary pass by reference from function parameter

Before

public static function sendMail(&$input, &$ids, $contributionID, &$values,
                                  $returnMessageText = FALSE) {

After

public static function sendMail($input, $ids, $contributionID, $returnMessageText = FALSE) {

Technical Details

Once #17982 is merged there are only 2 places that call this function. In both
places

  1. they instantiate an empty values array just to pass in
  2. we can see they don't use input or ids afterwards, so they don't need to be passed by reference

Comments

Will not pass until #17982 is merged

@civibot
Copy link

civibot bot commented Jul 28, 2020

(Standard links)

Once civicrm#17982 is merged there are only 2 places that call this function. In both
places
1) they instantiate an empty values array just to pass in
2) we can see they don't use input or ids afterwards, so they don't need to be passed by reference
@seamuslee001
Copy link
Contributor

Added the has test flag as the test fails show we have test coverage in this area

CRM_Core_Payment_BaseIPNTest.testsendMailMembershipObjects
CRM_Core_Payment_BaseIPNTest.testSendMailMembershipObjectsNoLeakage
CRM_Core_Payment_BaseIPNTest.testsendMailMembershipWithoutLoadObjects
CRM_Core_Payment_BaseIPNTest.testComposeMailParticipant
CRM_Core_Payment_BaseIPNTest.testComposeMailParticipantObjects
CRM_Core_Payment_BaseIPNTest.testsendMailPledge

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 yep - it needs #17982 merged in order to pass

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001 seamuslee001 merged commit a025e4e into civicrm:master Aug 1, 2020
@seamuslee001 seamuslee001 deleted the sendref branch August 1, 2020 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants