Skip to content

Commit a312708

Browse files
committed
Remove getIterator method
1 parent 97f7fec commit a312708

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

+2-11
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,18 @@ private function exhaustIterator() : void
124124
$this->iterator = null;
125125
}
126126

127-
private function getIterator() : Generator
128-
{
129-
if ($this->iterator === null) {
130-
throw new RuntimeException('Iterator has already been destroyed');
131-
}
132-
133-
return $this->iterator;
134-
}
135-
136127
/**
137128
* Stores the current item in the cache.
138129
*/
139130
private function storeCurrentItem() : void
140131
{
141-
$key = $this->getIterator()->key();
132+
$key = $this->iterator->key();
142133

143134
if ($key === null) {
144135
return;
145136
}
146137

147-
$this->items[$key] = $this->getIterator()->current();
138+
$this->items[$key] = $this->iterator->current();
148139
}
149140

150141
private function wrapTraversable(Traversable $traversable) : Generator

0 commit comments

Comments
 (0)