Skip to content

Commit 1635cc1

Browse files
committed
Forward compatibility with react/promise 3
1 parent bf683a6 commit 1635cc1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
4242
"react/event-loop": "^1.2",
4343
"react/dns": "^1.7",
44-
"react/promise": "~2.1|~1.2"
44+
"react/promise": "^3 || ^2.1 || ^1.2"
4545
},
4646
"require-dev": {
4747
"clue/block-react": "~1.0",

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function ($_, $reject) use ($promise) {
140140
$reject(new \RuntimeException('Cancelled creating socket during DNS lookup'));
141141

142142
// (try to) cancel pending DNS lookup, otherwise ignoring its results
143-
if ($promise instanceof CancellablePromiseInterface) {
143+
if (method_exists($promise, 'cancel')) {
144144
$promise->cancel();
145145
}
146146
}

0 commit comments

Comments
 (0)