File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 18
18
namespace MongoDB ;
19
19
20
20
use Iterator ;
21
- use MongoDB \Driver \Cursor ;
22
21
use MongoDB \Driver \CursorId ;
23
22
use MongoDB \Driver \Exception \ConnectionException ;
24
23
use MongoDB \Driver \Exception \RuntimeException ;
29
28
use MongoDB \Model \ChangeStreamIterator ;
30
29
use ReturnTypeWillChange ;
31
30
32
- use function assert ;
33
31
use function call_user_func ;
34
32
use function in_array ;
35
33
@@ -116,10 +114,7 @@ public function current()
116
114
*/
117
115
public function getCursorId ()
118
116
{
119
- $ cursor = $ this ->iterator ->getInnerIterator ();
120
- assert ($ cursor instanceof Cursor);
121
-
122
- return $ cursor ->getId ();
117
+ return $ this ->iterator ->getInnerIterator ()->getId ();
123
118
}
124
119
125
120
/**
Original file line number Diff line number Diff line change 30
30
use MongoDB \Exception \UnexpectedValueException ;
31
31
use ReturnTypeWillChange ;
32
32
33
+ use function assert ;
33
34
use function count ;
34
35
use function is_array ;
35
36
use function is_object ;
44
45
* rewind() do not execute getMore commands.
45
46
*
46
47
* @internal
47
- * @method Cursor getInnerIterator()
48
48
*/
49
49
class ChangeStreamIterator extends IteratorIterator implements CommandSubscriber
50
50
{
@@ -135,6 +135,14 @@ public function current()
135
135
return $ this ->isValid ? parent ::current () : null ;
136
136
}
137
137
138
+ final public function getInnerIterator (): Cursor
139
+ {
140
+ $ cursor = parent ::getInnerIterator ();
141
+ assert ($ cursor instanceof Cursor);
142
+
143
+ return $ cursor ;
144
+ }
145
+
138
146
/**
139
147
* Returns the resume token for the iterator's current position.
140
148
*
You can’t perform that action at this time.
0 commit comments