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] [Export] Simplify setting of address strings #14835

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Minor refactor of export strings (this is well tested code)

Before

Less readable

After

More readable

Technical Details

Comments

@civibot
Copy link

civibot bot commented Jul 16, 2019

(Standard links)

@civibot civibot bot added the master label Jul 16, 2019
@colemanw
Copy link
Member

colemanw commented Jul 16, 2019

Hmm, I don't quite understand how this simplifies things. It's an additional param to ExportProcessor::__construct and appears to increase coupling with the form without reducing code in the form.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw well $exportParams is ALREADY the formValues array - so we are renaming it to be more accurate. In addition we are moving it out of random place to being analysed at the start so we can stop passing the array around the exportComponents function. I'd rather split it out better but this gets it out of the 'deep down' part of the function

@eileenmcnaughton
Copy link
Contributor Author

test this please

1 similar comment
@eileenmcnaughton
Copy link
Contributor Author

test this please

* - addresee_greeting
* - addressee_other
*/
public function __construct($exportMode, $requestedFields, $queryOperator, $isMergeSameHousehold = FALSE, $isPostalableOnly = FALSE, $isMergeSameAddress = FALSE, $formValues = []) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't adopted an official documentation standard for arrays, but I like the looks of this one: https://stackoverflow.com/a/51032174/2918050

@colemanw
Copy link
Member

Ok I'll take your word for it. I left one comment about the formatting of the docblock, but other than that it looks good.

@colemanw colemanw merged commit 869b8ee into civicrm:master Jul 17, 2019
@eileenmcnaughton eileenmcnaughton deleted the export branch July 17, 2019 19:16
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.

2 participants