Code Duplication    Length = 5-6 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Iterator/BaseIterator.php 1 location

@@ 131-136 (lines=6) @@
128
129
    private function wrapTraversable(Traversable $traversable) : Generator
130
    {
131
        foreach ($traversable as $key => $value) {
132
            $this->key = $key;
133
            $this->current = $value;
134
            yield $key => $value;
135
            $this->iteratorAdvanced = true;
136
        }
137
138
        $this->iterator = null;
139
        $this->key = null;

lib/Doctrine/ODM/MongoDB/Iterator/CachingIterator.php 1 location

@@ 143-147 (lines=5) @@
140
141
    private function wrapTraversable(Traversable $traversable) : Generator
142
    {
143
        foreach ($traversable as $key => $value) {
144
            $this->items[$key] = $value;
145
            yield $key => $value;
146
            $this->iteratorAdvanced = true;
147
        }
148
149
        $this->iterator = null;
150
    }