You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ChangeStream.php
+6-31Lines changed: 6 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@
21
21
useMongoDB\BSON\Document;
22
22
useMongoDB\BSON\Int64;
23
23
useMongoDB\Codec\DocumentCodec;
24
-
useMongoDB\Driver\CursorId;
25
24
useMongoDB\Driver\Exception\ConnectionException;
26
25
useMongoDB\Driver\Exception\RuntimeException;
27
26
useMongoDB\Driver\Exception\ServerException;
@@ -33,10 +32,6 @@
33
32
usefunctionassert;
34
33
usefunctioncall_user_func;
35
34
usefunctionin_array;
36
-
usefunctionsprintf;
37
-
usefunctiontrigger_error;
38
-
39
-
useconstE_USER_DEPRECATED;
40
35
41
36
/**
42
37
* Iterator for a change stream.
@@ -88,12 +83,8 @@ class ChangeStream implements Iterator
88
83
*/
89
84
privatebool$hasAdvanced = false;
90
85
91
-
/**
92
-
* @see https://php.net/iterator.current
93
-
* @return array|object|null
94
-
*/
95
-
#[ReturnTypeWillChange]
96
-
publicfunctioncurrent()
86
+
/** @see https://php.net/iterator.current */
87
+
publicfunctioncurrent(): array|object|null
97
88
{
98
89
$value = $this->iterator->current();
99
90
@@ -106,26 +97,9 @@ public function current()
106
97
return$this->codec->decode($value);
107
98
}
108
99
109
-
/**
110
-
* @return CursorId|Int64
111
-
* @psalm-return ($asInt64 is true ? Int64 : CursorId)
112
-
*/
113
-
#[ReturnTypeWillChange]
114
-
publicfunctiongetCursorId(bool$asInt64 = false)
100
+
publicfunctiongetCursorId(): Int64
115
101
{
116
-
if (! $asInt64) {
117
-
@trigger_error(
118
-
sprintf(
119
-
'The method "%s" will no longer return a "%s" instance in the future. Pass "true" as argument to change to the new behavior and receive a "%s" instance instead.',
* @psalm-return ($asInt64 is true ? Int64 : CursorId)
77
-
*/
78
-
#[ReturnTypeWillChange]
79
-
publicfunctiongetId(bool$asInt64 = false)
68
+
publicfunctiongetId(): Int64
80
69
{
81
-
if (! $asInt64) {
82
-
@trigger_error(
83
-
sprintf(
84
-
'The method "%s" will no longer return a "%s" instance in the future. Pass "true" as argument to change to the new behavior and receive a "%s" instance instead.',
0 commit comments