1
1
<?php
2
+ declare (strict_types=1 );
3
+
2
4
/*
3
5
* The MIT License
4
6
*
@@ -45,7 +47,7 @@ class ResultSet implements ResultSetInterface
45
47
/**
46
48
* Query instance.
47
49
*
48
- * @var Query
50
+ * @var \Cake\ORM\ Query
49
51
*/
50
52
protected $ query ;
51
53
@@ -113,15 +115,15 @@ class ResultSet implements ResultSetInterface
113
115
* @var array
114
116
*/
115
117
protected $ _defaultConfig = [
116
- 'size ' => 1000
118
+ 'size ' => 1000 ,
117
119
];
118
120
119
121
/**
120
122
* Constructor.
121
123
*
122
- * @param Query $query Query object.
124
+ * @param \Cake\ORM\ Query $query Query object.
123
125
* @param array $config Configuration.
124
- * @throws RuntimeException When query is not supported.
126
+ * @throws \ RuntimeException When query is not supported.
125
127
*/
126
128
public function __construct (Query $ query , array $ config = [])
127
129
{
@@ -140,34 +142,36 @@ public function __construct(Query $query, array $config = [])
140
142
}
141
143
142
144
/**
143
- * { @inheritDoc}
145
+ * @inheritDoc
144
146
*/
147
+ #[\ReturnTypeWillChange]
145
148
public function current ()
146
149
{
147
150
return $ this ->current ;
148
151
}
149
152
150
153
/**
151
- * { @inheritDoc}
154
+ * @inheritDoc
152
155
*/
156
+ #[\ReturnTypeWillChange]
153
157
public function key ()
154
158
{
155
159
return $ this ->index ;
156
160
}
157
161
158
162
/**
159
- * { @inheritDoc}
163
+ * @inheritDoc
160
164
*/
161
- public function next ()
165
+ public function next (): void
162
166
{
163
167
$ this ->index ++;
164
168
$ this ->chunkIndex ++;
165
169
}
166
170
167
171
/**
168
- * { @inheritDoc}
172
+ * @inheritDoc
169
173
*/
170
- public function rewind ()
174
+ public function rewind (): void
171
175
{
172
176
$ this ->index = 0 ;
173
177
$ this ->page = 1 ;
@@ -176,9 +180,9 @@ public function rewind()
176
180
}
177
181
178
182
/**
179
- * { @inheritDoc}
183
+ * @inheritDoc
180
184
*/
181
- public function valid ()
185
+ public function valid (): bool
182
186
{
183
187
if ($ this ->limit && $ this ->index >= $ this ->limit ) {
184
188
return false ;
@@ -235,30 +239,40 @@ protected function fetchChunk()
235
239
}
236
240
237
241
/**
238
- * { @inheritDoc}
242
+ * @inheritDoc
239
243
*/
240
- public function count ()
244
+ public function count (): int
241
245
{
242
246
throw new RuntimeException ('Count is not supported yet. ' );
243
247
}
244
248
245
249
/**
246
- * Serialization is not supported (yet).
247
- *
248
250
* {@inheritDoc}
251
+ *
252
+ * Serialization is not supported (yet). *
249
253
*/
250
254
public function serialize ()
251
255
{
252
256
throw new RuntimeException ('You cannot serialize this result set. ' );
253
257
}
254
258
259
+ public function __serialize (): array
260
+ {
261
+ throw new RuntimeException ('You cannot serialize this result set. ' );
262
+ }
263
+
255
264
/**
256
- * Serialization is not supported (yet).
257
- *
258
265
* {@inheritDoc}
266
+ *
267
+ * Serialization is not supported (yet). *
259
268
*/
260
269
public function unserialize ($ serialized )
261
270
{
262
271
throw new RuntimeException ('You cannot unserialize this result set. ' );
263
272
}
273
+
274
+ public function __unserialize (array $ data ): void
275
+ {
276
+ throw new RuntimeException ('You cannot unserialize this result set. ' );
277
+ }
264
278
}
0 commit comments