@@ -255,8 +255,7 @@ public function toArray($associative = true, ...$keys): array
255255 *
256256 * @since 1.0
257257 */
258- #[\ReturnTypeWillChange]
259- public function count ()
258+ public function count (): int
260259 {
261260 return \count ($ this ->objects );
262261 }
@@ -268,7 +267,7 @@ public function count()
268267 *
269268 * @since 1.0
270269 */
271- public function clear ()
270+ public function clear (): DataSet
272271 {
273272 $ this ->objects = [];
274273 $ this ->rewind ();
@@ -279,12 +278,11 @@ public function clear()
279278 /**
280279 * Get the current data object in the set.
281280 *
282- * @return DataObject|false The current object, or false if the array is empty or the pointer is beyond the end of the elements.
281+ * @return DataObject|bool The current object, or false if the array is empty or the pointer is beyond the end of the elements.
283282 *
284283 * @since 1.0
285284 */
286- #[\ReturnTypeWillChange]
287- public function current ()
285+ public function current (): DataObject |bool
288286 {
289287 return is_scalar ($ this ->current ) ? $ this ->objects [$ this ->current ] : false ;
290288 }
@@ -351,12 +349,11 @@ public function jsonSerialize(): array
351349 /**
352350 * Gets the key of the current object in the iterator.
353351 *
354- * @return integer|false The object key on success; false on failure.
352+ * @return int|bool|null The object key on success; false on failure.
355353 *
356354 * @since 1.0
357355 */
358- #[\ReturnTypeWillChange]
359- public function key ()
356+ public function key (): int |bool |null
360357 {
361358 return $ this ->current ;
362359 }
@@ -399,8 +396,7 @@ public function walk(callable $funcname): bool
399396 *
400397 * @since 1.0
401398 */
402- #[\ReturnTypeWillChange]
403- public function next ()
399+ public function next (): void
404400 {
405401 // Get the object offsets.
406402 $ keys = $ this ->keys ();
@@ -433,8 +429,7 @@ public function next()
433429 *
434430 * @since 1.0
435431 */
436- #[\ReturnTypeWillChange]
437- public function offsetExists ($ offset )
432+ public function offsetExists ($ offset ): bool
438433 {
439434 return isset ($ this ->objects [$ offset ]);
440435 }
@@ -448,8 +443,7 @@ public function offsetExists($offset)
448443 *
449444 * @since 1.0
450445 */
451- #[\ReturnTypeWillChange]
452- public function offsetGet ($ offset )
446+ public function offsetGet ($ offset ): DataObject |null
453447 {
454448 return $ this ->objects [$ offset ] ?? null ;
455449 }
@@ -465,8 +459,7 @@ public function offsetGet($offset)
465459 * @since 1.0
466460 * @throws \InvalidArgumentException if an object is not an instance of DataObject.
467461 */
468- #[\ReturnTypeWillChange]
469- public function offsetSet ($ offset , $ object )
462+ public function offsetSet ($ offset , $ object ): void
470463 {
471464 if (!($ object instanceof DataObject)) {
472465 throw new \InvalidArgumentException (
@@ -495,8 +488,7 @@ public function offsetSet($offset, $object)
495488 *
496489 * @since 1.0
497490 */
498- #[\ReturnTypeWillChange]
499- public function offsetUnset ($ offset )
491+ public function offsetUnset ($ offset ): void
500492 {
501493 if (!isset ($ this [$ offset ])) {
502494 // Do nothing if the offset does not exist.
@@ -529,8 +521,7 @@ public function offsetUnset($offset)
529521 *
530522 * @since 1.0
531523 */
532- #[\ReturnTypeWillChange]
533- public function rewind ()
524+ public function rewind (): void
534525 {
535526 // Set the current position to the first object.
536527 if (empty ($ this ->objects )) {
@@ -548,8 +539,7 @@ public function rewind()
548539 *
549540 * @since 1.0
550541 */
551- #[\ReturnTypeWillChange]
552- public function valid ()
542+ public function valid (): bool
553543 {
554544 // Check the current position.
555545 if (!is_scalar ($ this ->current ) || !isset ($ this ->objects [$ this ->current ])) {
0 commit comments