diff --git a/lib/AsyncGenerator.php b/lib/AsyncGenerator.php index e307e95..0f6ca82 100644 --- a/lib/AsyncGenerator.php +++ b/lib/AsyncGenerator.php @@ -60,7 +60,7 @@ final class AsyncGenerator implements Stream */ public function transform(): TransformationStream { - return new TransformationStream($this); + return $this->generator->transform(); } /** diff --git a/lib/Internal/AutoDisposingStream.php b/lib/Internal/AutoDisposingStream.php index 6effab4..6152f4a 100644 --- a/lib/Internal/AutoDisposingStream.php +++ b/lib/Internal/AutoDisposingStream.php @@ -51,6 +51,6 @@ class AutoDisposingStream implements Stream */ public function transform(): TransformationStream { - return new TransformationStream($this); + return $this->stream->transform(); } }