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

[5.8] Move Collection::add() #27082

Merged
merged 1 commit into from
Jan 6, 2019
Merged

[5.8] Move Collection::add() #27082

merged 1 commit into from
Jan 6, 2019

Conversation

staudenmeir
Copy link
Contributor

We can move the add() method up to the base collection.

@taylorotwell taylorotwell merged commit 7cf9142 into laravel:master Jan 6, 2019
@staudenmeir staudenmeir deleted the collection branch January 6, 2019 21:45
@fulopattila122
Copy link

What was the reason behind this move?

@staudenmeir
Copy link
Contributor Author

The add() method is not specific to Eloquent, it makes more sense in the base collection.

@4refael
Copy link
Contributor

4refael commented Mar 17, 2019

Is this method even necessary? Isn't it the same as the push() method?

@staudenmeir
Copy link
Contributor Author

It is the same, but removing it would be an unnecessary breaking change.

@4refael
Copy link
Contributor

4refael commented Mar 17, 2019

It can be marked deprecated at least.
I mean, I don't see how moving it makes it better.

@devcircus
Copy link
Contributor

It's not that it makes it better, it's just where the generic collection methods belong. It does seem like it could be deprecated in master.

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.

5 participants