Skip to content

Collection replace and replaceRecursively functions#20220

Closed
salarmehr wants to merge 2 commits intolaravel:5.4from
salarmehr:5.4
Closed

Collection replace and replaceRecursively functions#20220
salarmehr wants to merge 2 commits intolaravel:5.4from
salarmehr:5.4

Conversation

@salarmehr
Copy link
Copy Markdown

No description provided.

@lk77
Copy link
Copy Markdown

lk77 commented Jul 23, 2017

I think replacing in collections is not needed by the framework,
a PR was declined on this functionality recently if i remember correctly
You should use map function instead.

*
* @param mixed $items
* @return static
* @see http://php.net/manual/en/function.array-replace-recursive.php
Copy link
Copy Markdown

@lk77 lk77 Jul 23, 2017

Choose a reason for hiding this comment

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

it's http://php.net/manual/en/function.array-replace.php
And why there is a non-used and non-documented $recursive parameter?

@taylorotwell
Copy link
Copy Markdown
Member

No plans to add this.

@salarmehr
Copy link
Copy Markdown
Author

@taylorotwell
Thanks for you comment. Can you please give a hint that what sort of things are planed? In the collection there are a number of non-essential methods (e.g. median()) while the "replacing" items is such important that php has two build-in function for that. (or is there any downside for including replace)

BTW, the last year that I pushed this for the first time it seems the reaction to that was positive #15157

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.

3 participants