Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Ability to replace key in ArrayUtils::merge #6903

Conversation

snapshotpl
Copy link
Contributor

It's related with remove key #6899 @Ocramius


namespace Zend\Stdlib\ArrayUtils;

class MergeReplaceKey
Copy link
Member

Choose a reason for hiding this comment

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

I would also suggest making this final

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? By final we close the doors to extending logic in this class. I see use case where someone want to add filter to this.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is indeed what final is for. This object is just a thin data wrapper, and I don't see any advantage in extending it, not even in cases where you want to fetch data from, say, a DB connection.

If you think there is a use-case for extension, then I suggest interfacing it instead, and making this concrete implementation final

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The interface makes sense

@Ocramius
Copy link
Member

Ocramius commented Dec 6, 2014

@snapshotpl manually merged, thank you!

develop: bb903fb

@Ocramius Ocramius closed this Dec 6, 2014
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…removing inherited docblock documentation
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants