Skip to content

Commit 15239b4

Browse files
committed
refactor: ArrayIterator has deprecated on PHP 8.5
1 parent 3c10cc1 commit 15239b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system/Cookie/CookieStore.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace CodeIgniter\Cookie;
1515

16-
use ArrayIterator;
1716
use CodeIgniter\Cookie\Exceptions\CookieException;
1817
use Countable;
1918
use IteratorAggregate;
@@ -192,7 +191,9 @@ public function count(): int
192191
*/
193192
public function getIterator(): Traversable
194193
{
195-
return new ArrayIterator($this->cookies);
194+
foreach ($this->cookies as $key => $value) {
195+
yield $key => $value;
196+
}
196197
}
197198

198199
/**

0 commit comments

Comments
 (0)