From 551afa3c0c947b6aaa1e97085413fcf331b2e53f Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Thu, 20 Nov 2025 21:29:04 +0300 Subject: [PATCH] Extend Traversable in Iterator --- src/Internal/Iter/PipelineIterator.php | 3 ++- src/Iterator.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Internal/Iter/PipelineIterator.php b/src/Internal/Iter/PipelineIterator.php index 1bf48a0..6c12a75 100644 --- a/src/Internal/Iter/PipelineIterator.php +++ b/src/Internal/Iter/PipelineIterator.php @@ -15,8 +15,9 @@ * @internal * @template-covariant T * @template-implements Iterator + * @template-implements \IteratorAggregate */ -final class PipelineIterator implements Iterator +final class PipelineIterator implements Iterator, \IteratorAggregate { /** @var ?Future */ private ?Future $complete = null; diff --git a/src/Iterator.php b/src/Iterator.php index c66baab..efb6cd0 100644 --- a/src/Iterator.php +++ b/src/Iterator.php @@ -9,9 +9,9 @@ /** * @api * @template-covariant T - * @template-extends \IteratorAggregate + * @template-extends \Traversable */ -interface Iterator extends \IteratorAggregate +interface Iterator extends \Traversable { public function stop(?Cancellation $cancellation = null): void;