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

Fix include orders #314

Merged
merged 3 commits into from
Mar 16, 2016
Merged

Fix include orders #314

merged 3 commits into from
Mar 16, 2016

Conversation

grobx
Copy link
Contributor

@grobx grobx commented Feb 23, 2016

}
}

return $data;
return $includeData;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@piribes I feel like changing $includeData makes the intention here less clear, since conceptually $includeData should be appended to $data. Instead, let's just create a new variable, $newData or something, and return it. Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense to me, i have updated the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@theofidry i created $newData instead of reusing $includeData just for code clarity, as stated here by @tshelburne
If you think it is incorrect, there's no problem, we can rollback whenever we want, of course :)

Copy link
Member

Choose a reason for hiding this comment

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

To me it's just that in this case if the name is not clear enough it should be changed in the signature :)

That being said I'm saying that because I find this line useless that's it. If you or @tshelburne find it more clear to do it this way I'm fine with it.

foreach ($includeData as $class => $fixtures) {
if (isset($data[$class])) {
$data[$class] = array_merge($fixtures, $data[$class]);
$newData = $includeData;
Copy link
Member

Choose a reason for hiding this comment

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

$newData is unneeded, you can use $includeData right away

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is per my request earlier - I feel like this variable name makes the intention much more clear.

@grobx
Copy link
Contributor Author

grobx commented Mar 16, 2016

Any chance ?

@theofidry
Copy link
Member

👍 As far as I can tell there is no BC break so can be released in a patch :)

tshelburne added a commit that referenced this pull request Mar 16, 2016
@tshelburne tshelburne merged commit 9c05a91 into nelmio:master Mar 16, 2016
@tshelburne
Copy link
Collaborator

Makes sense to me - @piribes thanks!

@grobx
Copy link
Contributor Author

grobx commented Mar 16, 2016

my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion on MergeInclude
3 participants