Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 154-162 (lines=9) @@
151
        $this->items[$key] = $this->getIterator()->current();
152
    }
153
154
    private function wrapTraversable(Traversable $traversable) : Generator
155
    {
156
        foreach ($traversable as $key => $value) {
157
            yield $key => $value;
158
            $this->iteratorAdvanced = true;
159
        }
160
161
        $this->iteratorExhausted = true;
162
    }
163
}
164

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

@@ 125-133 (lines=9) @@
122
        return $this->iterator;
123
    }
124
125
    private function wrapTraversable(Traversable $traversable) : Generator
126
    {
127
        foreach ($traversable as $key => $value) {
128
            yield $key => $value;
129
            $this->iteratorAdvanced = true;
130
        }
131
132
        $this->iterator = null;
133
    }
134
}
135