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

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