Skip to content

Commit ad66c12

Browse files
committed
chore: declare return of pipe() methods by @template
1 parent 1e5b0ac commit ad66c12

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ReadableStreamInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,10 @@ public function resume();
318318
* Once the pipe is set up successfully, the destination stream MUST emit
319319
* a `pipe` event with this source stream an event argument.
320320
*
321-
* @param WritableStreamInterface $dest
321+
* @template T of WritableStreamInterface
322+
* @param T $dest
322323
* @param array $options
323-
* @return WritableStreamInterface $dest stream as-is
324+
* @return T $dest stream as-is
324325
*/
325326
public function pipe(WritableStreamInterface $dest, array $options = array());
326327

src/Util.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ final class Util
77
/**
88
* Pipes all the data from the given $source into the $dest
99
*
10+
* @template T of WritableStreamInterface
1011
* @param ReadableStreamInterface $source
11-
* @param WritableStreamInterface $dest
12+
* @param T $dest
1213
* @param array $options
13-
* @return WritableStreamInterface $dest stream as-is
14+
* @return T $dest stream as-is
1415
* @see ReadableStreamInterface::pipe() for more details
1516
*/
1617
public static function pipe(ReadableStreamInterface $source, WritableStreamInterface $dest, array $options = array())

0 commit comments

Comments
 (0)