File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 3636 "require" : {
3737 "php" : " >=5.3" ,
3838 "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"
4040 },
4141 "require-dev" : {
4242 "react/event-loop" : " ^1.0 || ^0.5 || ^0.4 || ^0.3" ,
Original file line number Diff line number Diff line change 44
55use Evenement \EventEmitter ;
66use InvalidArgumentException ;
7- use React \Promise \CancellablePromiseInterface ;
87use React \Promise \PromiseInterface ;
98use React \Stream \ReadableStreamInterface ;
109use React \Stream \Util ;
@@ -126,7 +125,7 @@ public function close()
126125 $ this ->closed = true ;
127126
128127 // try to cancel promise once the stream closes
129- if ($ this ->promise instanceof CancellablePromiseInterface ) {
128+ if ($ this ->promise !== null && \method_exists ( $ this -> promise , ' cancel ' ) ) {
130129 $ this ->promise ->cancel ();
131130 }
132131 $ this ->promise = null ;
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ public function close()
153153 $ this ->closed = true ;
154154
155155 // try to cancel promise once the stream closes
156- if ($ this ->promise instanceof CancellablePromiseInterface ) {
156+ if ($ this ->promise !== null && \method_exists ( $ this -> promise , ' cancel ' ) ) {
157157 $ this ->promise ->cancel ();
158158 }
159159 $ this ->promise = $ this ->stream = null ;
You can’t perform that action at this time.
0 commit comments