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

[NFC] code cleanup: split out 2 functions that are mostly unrelated. #11284

Merged
merged 1 commit into from
Nov 18, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Code cleanup only

Before

One function does 2 very different things depending on one parameter

After

Function is split into 2

Technical Details

The handling of line items & financial items has been munged together in a way that gains little, adds confusion,
and blocks the financial items portion from being re-usable.

This is a code cleanup preparatory to the actual changes in pr #10962

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb another nfc subset of #10962

@seamuslee001
Copy link
Contributor

The handling of line items & financial items has been munged together in a way that gains little, adds confusion,
and blocks the financial items portion from being re-usable.

This is a code cleanup preparatory to the actual changes in pr civicrm#10962
@eileenmcnaughton
Copy link
Contributor Author

thanks @seamuslee001 -hopefully fixed now

@eileenmcnaughton
Copy link
Contributor Author

Note if anyone wants to review this I think the easiest steps are actually to redo the refactor & see if you get the same results. Basically I copied the function & renamed it & then changed the second place to call the second function. Once you start pulling out parameters that are no longer required it kinda falls into place

@eileenmcnaughton
Copy link
Contributor Author

little green tick

@mlutfy
Copy link
Member

mlutfy commented Nov 18, 2017

Merging based on code review. I see that there are a few unit tests calling changeFeeSelections, so hopefully that would catch the supported use-cases.

@mlutfy mlutfy merged commit f0e4d11 into civicrm:master Nov 18, 2017
@eileenmcnaughton eileenmcnaughton deleted the towards1 branch November 18, 2017 00:42
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
[NFC] code cleanup: split out 2 functions that are mostly unrelated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants