Skip to content

Commit bea5352

Browse files
committed
Assert iterator type in ChangeStreamIterator::getInnerIterator
1 parent bc0de5c commit bea5352

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Model/ChangeStreamIterator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,14 @@ public function current()
149149
* iterator. This could be side-stepped due to the class not being final,
150150
* but it's very much an invalid use-case. This method can be dropped in 2.0
151151
* once the class is final.
152+
*
153+
* @return CursorInterface<int, TValue>&Iterator<int, TValue>
152154
*/
153-
final public function getInnerIterator(): CursorInterface
155+
final public function getInnerIterator(): Iterator
154156
{
155157
$cursor = parent::getInnerIterator();
156158
assert($cursor instanceof CursorInterface);
159+
assert($cursor instanceof Iterator);
157160

158161
return $cursor;
159162
}

0 commit comments

Comments
 (0)