File tree 3 files changed +3
-5
lines changed 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 36
36
"require" : {
37
37
"php" : " >=5.3" ,
38
38
"react/stream" : " ^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6" ,
39
- "react/promise" : " ^2.1 || ^1.2"
39
+ "react/promise" : " ^3 || ^ 2.1 || ^1.2"
40
40
},
41
41
"require-dev" : {
42
42
"react/event-loop" : " ^1.0 || ^0.5 || ^0.4 || ^0.3" ,
Original file line number Diff line number Diff line change 4
4
5
5
use Evenement \EventEmitter ;
6
6
use InvalidArgumentException ;
7
- use React \Promise \CancellablePromiseInterface ;
8
7
use React \Promise \PromiseInterface ;
9
8
use React \Stream \ReadableStreamInterface ;
10
9
use React \Stream \Util ;
@@ -126,7 +125,7 @@ public function close()
126
125
$ this ->closed = true ;
127
126
128
127
// try to cancel promise once the stream closes
129
- if ($ this ->promise instanceof CancellablePromiseInterface ) {
128
+ if ($ this ->promise !== null && \method_exists ( $ this -> promise , ' cancel ' ) ) {
130
129
$ this ->promise ->cancel ();
131
130
}
132
131
$ this ->promise = null ;
Original file line number Diff line number Diff line change 4
4
5
5
use Evenement \EventEmitter ;
6
6
use InvalidArgumentException ;
7
- use React \Promise \CancellablePromiseInterface ;
8
7
use React \Promise \PromiseInterface ;
9
8
use React \Stream \WritableStreamInterface ;
10
9
@@ -153,7 +152,7 @@ public function close()
153
152
$ this ->closed = true ;
154
153
155
154
// try to cancel promise once the stream closes
156
- if ($ this ->promise instanceof CancellablePromiseInterface ) {
155
+ if ($ this ->promise !== null && \method_exists ( $ this -> promise , ' cancel ' ) ) {
157
156
$ this ->promise ->cancel ();
158
157
}
159
158
$ this ->promise = $ this ->stream = null ;
You can’t perform that action at this time.
0 commit comments