Skip to content

Renamed array_set to array_replace_at #108

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

Merged
merged 1 commit into from
Oct 25, 2014
Merged

Conversation

dantleech
Copy link
Member

//cc @dbu

@dantleech
Copy link
Member Author

I am not sure about this: array_replace_at implies that the index must exist. Would it ever be a valid case to set a non-existing index? I guess not, but if it were valid then array_set would be a better name,

dantleech added a commit that referenced this pull request Oct 25, 2014
Renamed array_set to array_replace_at
@dantleech dantleech merged commit baa9298 into master Oct 25, 2014
@dantleech dantleech deleted the fix_update_function_names branch October 25, 2014 07:39
@dbu
Copy link
Member

dbu commented Oct 25, 2014

as phpcr arrays are consequitive arrays and not hashmaps, you can't set a new index. we could allow the edge case of hitting the spot after the last element and in this case add the element. or in general say that if the index is higher than the last, it actually appends. this is probably better than doing an error in that case.

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