File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public function offsetExists($offset): bool
74
74
return isset ($ this ->headers [strtolower ($ offset )]);
75
75
}
76
76
77
- public function offsetGet ($ offset )
77
+ public function offsetGet ($ offset ): mixed
78
78
{
79
79
$ l = strtolower ($ offset );
80
80
Original file line number Diff line number Diff line change @@ -175,6 +175,20 @@ public function unserialize($serialize)
175
175
$ this ->__construct ($ data ['status ' ], $ data ['headers ' ], $ data ['body ' ]);
176
176
}
177
177
178
+ public function __serialize (): array
179
+ {
180
+ return array (
181
+ 'status ' => $ this ->statusCode ,
182
+ 'body ' => (string ) $ this ->body ,
183
+ 'headers ' => $ this ->headers ->toArray ()
184
+ );
185
+ }
186
+
187
+ public function __unserialize (array $ data ): void
188
+ {
189
+ $ this ->__construct ($ data ['status ' ], $ data ['headers ' ], $ data ['body ' ]);
190
+ }
191
+
178
192
/**
179
193
* Get the response entity body
180
194
*
Original file line number Diff line number Diff line change @@ -121,17 +121,17 @@ public function set($key, $value)
121
121
return $ this ;
122
122
}
123
123
124
- public function current ()
124
+ public function current (): mixed
125
125
{
126
126
return $ this ->resources ? current ($ this ->resources ) : false ;
127
127
}
128
128
129
- public function key ()
129
+ public function key (): mixed
130
130
{
131
131
return max (0 , $ this ->iteratedCount - 1 );
132
132
}
133
133
134
- public function count ()
134
+ public function count (): int
135
135
{
136
136
return $ this ->retrievedCount ;
137
137
}
@@ -149,21 +149,21 @@ public function getRequestCount()
149
149
/**
150
150
* Rewind the Iterator to the first element and send the original command
151
151
*/
152
- public function rewind ()
152
+ public function rewind (): void
153
153
{
154
154
// Use the original command
155
155
$ this ->command = clone $ this ->originalCommand ;
156
156
$ this ->resetState ();
157
157
$ this ->next ();
158
158
}
159
159
160
- public function valid ()
160
+ public function valid (): bool
161
161
{
162
162
return !$ this ->invalid && (!$ this ->resources || $ this ->current () || $ this ->nextToken )
163
163
&& (!$ this ->limit || $ this ->iteratedCount < $ this ->limit + 1 );
164
164
}
165
165
166
- public function next ()
166
+ public function next (): void
167
167
{
168
168
$ this ->iteratedCount ++;
169
169
You can’t perform that action at this time.
0 commit comments