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

Stdlib\PriorityList fix current and iterator #6242

Closed
wants to merge 3 commits into from
Closed

Stdlib\PriorityList fix current and iterator #6242

wants to merge 3 commits into from

Conversation

turrsis
Copy link
Contributor

@turrsis turrsis commented May 8, 2014

add sort before get current()
add getIterator() which return cloned self instance

@@ -231,6 +232,14 @@ public function valid()
}

/**
* @return self
*/
public function getIterator()
Copy link
Member

Choose a reason for hiding this comment

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

This method is not needed unless PriorityList implements IteratorAggregate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for Stdlib\PriorityQueue continuity.
Interface is not implemented because \Iterator and \IteratorAggregate is incompatible.

*/
public function getIterator()
{
return clone $this;
Copy link
Member

Choose a reason for hiding this comment

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

Why cloning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Ocramius
Copy link
Member

Note to self: reword commits on merge

@Ocramius Ocramius modified the milestones: 2.3.2, 2.4.0 Jul 27, 2014
Ocramius added a commit that referenced this pull request Jul 27, 2014
@Ocramius
Copy link
Member

Manually merged @553e0a16ab07e49de0b46cdd8a6106e21b5b9978

@Ocramius Ocramius closed this Jul 27, 2014
@turrsis turrsis deleted the hotfix/stdlib/PriorityList/fixCurrentAndIterator branch October 21, 2014 13:54
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.

3 participants