File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 7
7
"php" : " >=5.3.0" ,
8
8
"react/cache" : " ^1.0 || ^0.6 || ^0.5" ,
9
9
"react/event-loop" : " ^1.0 || ^0.5" ,
10
- "react/promise" : " ^2.7 || ^1.2.1 " ,
11
- "react/promise-timer" : " ^1.2 "
10
+ "react/promise" : " dev-master as 2.999.999 " ,
11
+ "react/promise-timer" : " dev-promise-3 as 1.6.0 "
12
12
},
13
+ "repositories" : [
14
+ {
15
+ "type" : " vcs" ,
16
+ "url" : " https://github.com/WyriHaximus-labs/promise-timer"
17
+ }
18
+ ],
13
19
"require-dev" : {
14
20
"clue/block-react" : " ^1.2" ,
15
21
"phpunit/phpunit" : " ^7.0 || ^6.4 || ^5.7 || ^4.8.35"
Original file line number Diff line number Diff line change 4
4
5
5
use React \Promise \CancellablePromiseInterface ;
6
6
use React \Promise \Deferred ;
7
+ use React \Promise \PromiseInterface ;
7
8
8
9
final class RetryExecutor implements ExecutorInterface
9
10
{
@@ -24,7 +25,7 @@ public function query(Query $query)
24
25
public function tryQuery (Query $ query , $ retries )
25
26
{
26
27
$ deferred = new Deferred (function () use (&$ promise ) {
27
- if ($ promise instanceof CancellablePromiseInterface) {
28
+ if ($ promise instanceof CancellablePromiseInterface || ( method_exists ( $ promise , ' cancel ' ) && $ promise instanceof PromiseInterface) ) {
28
29
$ promise ->cancel ();
29
30
}
30
31
});
Original file line number Diff line number Diff line change 3
3
namespace React \Dns \Query ;
4
4
5
5
use React \EventLoop \LoopInterface ;
6
- use React \Promise \Deferred ;
7
- use React \Promise \CancellablePromiseInterface ;
8
6
use React \Promise \Timer ;
9
7
10
8
final class TimeoutExecutor implements ExecutorInterface
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ protected function expectPromiseOnce($return = null)
321
321
$ mock
322
322
->expects ($ this ->once ())
323
323
->method ('then ' )
324
- ->will ($ this ->returnValue ($ return ));
324
+ ->will ($ this ->returnValue (Promise \resolve ( $ return) ));
325
325
326
326
return $ mock ;
327
327
}
You can’t perform that action at this time.
0 commit comments