File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 8
8
use React \Stream \WritableStreamInterface ;
9
9
use React \Stream \Util ;
10
10
use React \Promise \CancellablePromiseInterface ;
11
+ use InvalidArgumentException ;
11
12
12
13
/**
13
14
* @internal
@@ -19,10 +20,9 @@ class UnwrapReadableStream extends EventEmitter implements ReadableStreamInterfa
19
20
private $ closed = false ;
20
21
21
22
/**
22
- * unwrap a `Promise` which resolves with a `ReadableStreamInterface`.
23
+ * Instantiate new unwrapped readable stream for given `Promise` which resolves with a `ReadableStreamInterface`.
23
24
*
24
25
* @param PromiseInterface $promise Promise<ReadableStreamInterface, Exception>
25
- * @return ReadableStreamInterface
26
26
*/
27
27
public function __construct (PromiseInterface $ promise )
28
28
{
@@ -32,7 +32,7 @@ public function __construct(PromiseInterface $promise)
32
32
$ this ->promise = $ promise ->then (
33
33
function ($ stream ) {
34
34
if (!($ stream instanceof ReadableStreamInterface)) {
35
- throw new \ InvalidArgumentException ('Not a readable stream ' );
35
+ throw new InvalidArgumentException ('Not a readable stream ' );
36
36
}
37
37
return $ stream ;
38
38
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace Clue \React \Promise \Stream ;
4
4
5
- use React \Stream \ReadableStream ;
6
5
use React \Stream \ReadableStreamInterface ;
7
6
use React \Promise ;
8
7
use React \Promise \PromiseInterface ;
9
- use React \Promise \CancellablePromiseInterface ;
10
8
11
9
/**
12
10
* Creates a `Promise` which resolves with the stream data buffer
You can’t perform that action at this time.
0 commit comments