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

Add vararg constructor to InMemoryEntityLookup #205

Merged
merged 1 commit into from Apr 17, 2019

Conversation

/**
* @param EntityDocument ...$entities
*/
public function __construct( ...$entities ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm somewhat surprised by this. I faced heavy backlash when I tried to introduce pretty much the exact same back then in wmde/WikibaseDataModel#376 and wmde/WikibaseDataModel#416. Not meant to block this, not even as a vote. I'm just curious what changed and what others think nowadays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I am doing here is adding an array parameter using varargs. That is not the same as changing an existing parameter to support two input styles. The context is also different.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would not call this an "array parameter". The ... syntax as documented at http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list does not allow callers to pass an array, but a "variable-length list of arguments". Which is what I wanted in these other pull requests.

@JeroenDeDauw
Copy link
Contributor Author

@manicki can you get this simple change unstuck?

@mariushoch
Copy link
Member

+1 Looks good to me

@JeroenDeDauw JeroenDeDauw merged commit 21fc8e1 into master Apr 17, 2019
@JeroenDeDauw JeroenDeDauw deleted the InMemoryEntityLookup branch April 17, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants