11<?php
2+ declare (strict_types=1 );
3+
24/*
35 * The MIT License
46 *
@@ -45,7 +47,7 @@ class ResultSet implements ResultSetInterface
4547 /**
4648 * Query instance.
4749 *
48- * @var Query
50+ * @var \Cake\ORM\ Query
4951 */
5052 protected $ query ;
5153
@@ -113,15 +115,15 @@ class ResultSet implements ResultSetInterface
113115 * @var array
114116 */
115117 protected $ _defaultConfig = [
116- 'size ' => 1000
118+ 'size ' => 1000 ,
117119 ];
118120
119121 /**
120122 * Constructor.
121123 *
122- * @param Query $query Query object.
124+ * @param \Cake\ORM\ Query $query Query object.
123125 * @param array $config Configuration.
124- * @throws RuntimeException When query is not supported.
126+ * @throws \ RuntimeException When query is not supported.
125127 */
126128 public function __construct (Query $ query , array $ config = [])
127129 {
@@ -140,34 +142,36 @@ public function __construct(Query $query, array $config = [])
140142 }
141143
142144 /**
143- * { @inheritDoc}
145+ * @inheritDoc
144146 */
147+ #[\ReturnTypeWillChange]
145148 public function current ()
146149 {
147150 return $ this ->current ;
148151 }
149152
150153 /**
151- * { @inheritDoc}
154+ * @inheritDoc
152155 */
156+ #[\ReturnTypeWillChange]
153157 public function key ()
154158 {
155159 return $ this ->index ;
156160 }
157161
158162 /**
159- * { @inheritDoc}
163+ * @inheritDoc
160164 */
161- public function next ()
165+ public function next (): void
162166 {
163167 $ this ->index ++;
164168 $ this ->chunkIndex ++;
165169 }
166170
167171 /**
168- * { @inheritDoc}
172+ * @inheritDoc
169173 */
170- public function rewind ()
174+ public function rewind (): void
171175 {
172176 $ this ->index = 0 ;
173177 $ this ->page = 1 ;
@@ -176,9 +180,9 @@ public function rewind()
176180 }
177181
178182 /**
179- * { @inheritDoc}
183+ * @inheritDoc
180184 */
181- public function valid ()
185+ public function valid (): bool
182186 {
183187 if ($ this ->limit && $ this ->index >= $ this ->limit ) {
184188 return false ;
@@ -235,30 +239,40 @@ protected function fetchChunk()
235239 }
236240
237241 /**
238- * { @inheritDoc}
242+ * @inheritDoc
239243 */
240- public function count ()
244+ public function count (): int
241245 {
242246 throw new RuntimeException ('Count is not supported yet. ' );
243247 }
244248
245249 /**
246- * Serialization is not supported (yet).
247- *
248250 * {@inheritDoc}
251+ *
252+ * Serialization is not supported (yet). *
249253 */
250254 public function serialize ()
251255 {
252256 throw new RuntimeException ('You cannot serialize this result set. ' );
253257 }
254258
259+ public function __serialize (): array
260+ {
261+ throw new RuntimeException ('You cannot serialize this result set. ' );
262+ }
263+
255264 /**
256- * Serialization is not supported (yet).
257- *
258265 * {@inheritDoc}
266+ *
267+ * Serialization is not supported (yet). *
259268 */
260269 public function unserialize ($ serialized )
261270 {
262271 throw new RuntimeException ('You cannot unserialize this result set. ' );
263272 }
273+
274+ public function __unserialize (array $ data ): void
275+ {
276+ throw new RuntimeException ('You cannot unserialize this result set. ' );
277+ }
264278}
0 commit comments