From 3c96fc44cf0f44b0fe43f9390a0ef58ed860bd47 Mon Sep 17 00:00:00 2001 From: Stanislau Kviatkouski <7zete7@gmail.com> Date: Fri, 22 Aug 2025 12:52:13 +0300 Subject: [PATCH] chore: declare return type of pipe() methods by @template --- src/ReadableStreamInterface.php | 5 +++-- src/Util.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ReadableStreamInterface.php b/src/ReadableStreamInterface.php index fa3d59c..39e29f9 100644 --- a/src/ReadableStreamInterface.php +++ b/src/ReadableStreamInterface.php @@ -318,9 +318,10 @@ public function resume(); * Once the pipe is set up successfully, the destination stream MUST emit * a `pipe` event with this source stream an event argument. * - * @param WritableStreamInterface $dest + * @template T of WritableStreamInterface + * @param T $dest * @param array $options - * @return WritableStreamInterface $dest stream as-is + * @return T $dest stream as-is */ public function pipe(WritableStreamInterface $dest, array $options = array()); diff --git a/src/Util.php b/src/Util.php index 056b037..09a7eb4 100644 --- a/src/Util.php +++ b/src/Util.php @@ -7,10 +7,11 @@ final class Util /** * Pipes all the data from the given $source into the $dest * + * @template T of WritableStreamInterface * @param ReadableStreamInterface $source - * @param WritableStreamInterface $dest + * @param T $dest * @param array $options - * @return WritableStreamInterface $dest stream as-is + * @return T $dest stream as-is * @see ReadableStreamInterface::pipe() for more details */ public static function pipe(ReadableStreamInterface $source, WritableStreamInterface $dest, array $options = array())