Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed key providing to ArrayCollection::map #10

Merged
merged 1 commit into from

2 participants

@hype-
Owner

No description provided.

@Ezku Ezku merged commit c9e51a5 into master

1 check failed

Details default Scrutinizer: 154 Comments, 2 Changed Files — Travis: Passed
@hype- hype- deleted the fix-keys-for-map branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2013
  1. @hype-
This page is out of date. Refresh to see the latest.
View
2  library/Xi/Collections/Collection/ArrayCollection.php
@@ -123,7 +123,7 @@ public function map($callback)
private function addKeyArgument($callback)
{
$values = $this->elements;
- return function($value) use($callback, $values) {
+ return function($value) use($callback, &$values) {
list($key) = each($values);
return $callback($value, $key);
};
View
1  tests/Xi/Collections/Collection/AbstractCollectionTest.php
@@ -145,6 +145,7 @@ public function keyMapSet()
{
return array(
array(array('foo' => null), array('foo' => 'foo')),
+ array(array('min' => 1, 'max' => 3), array('min' => 'min', 'max' => 'max')),
);
}
Something went wrong with that request. Please try again.