Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Clone collection before foreach in DuplicateKey filter
Browse files Browse the repository at this point in the history
  • Loading branch information
venimus committed Aug 24, 2015
1 parent e3dc567 commit d58097d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Filter/DuplicateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class DuplicateKey extends AbstractFilter implements FilterInterface
public function filter($collection)
{
$duplicateKeys = array();
$clonedCollection = array();

foreach ($collection as $key => $action) {
foreach ($collection as $key => $value) {
$clonedCollection[$key] = $value;
}

foreach ($clonedCollection as $key => $action) {
if ($action instanceof TimelineInterface) {
$action = $action->getAction();
}
Expand Down

0 comments on commit d58097d

Please sign in to comment.