From 9a58ddf311525d749466f18534a645282c3fdba0 Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Thu, 5 Dec 2024 09:53:29 +0100 Subject: [PATCH] fix tests --- src/Resources/CursorCollection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/CursorCollection.php b/src/Resources/CursorCollection.php index 31b55b1c..84c15947 100644 --- a/src/Resources/CursorCollection.php +++ b/src/Resources/CursorCollection.php @@ -98,9 +98,9 @@ public function getAutoIterator(bool $iterateBackwards = false): LazyCollection $page = $this; return new LazyCollection(function () use ($page, $iterateBackwards): Generator { - $page->setAutoHydrate(); - while (true) { + $page->setAutoHydrate(); + foreach ($page as $item) { yield $item; }