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

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