diff --git a/composer.json b/composer.json index c5b5934..182a3a5 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "react/event-loop": "^1.2", "react/dns": "^1.7", - "react/promise": "~2.1|~1.2" + "react/promise": "^3 || ^2.1 || ^1.2" }, "require-dev": { "clue/block-react": "~1.0", diff --git a/src/Factory.php b/src/Factory.php index f5e6d18..89586a6 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -9,7 +9,6 @@ use React\EventLoop\Loop; use React\EventLoop\LoopInterface; use React\Promise; -use React\Promise\CancellablePromiseInterface; use \Exception; class Factory @@ -140,7 +139,7 @@ function ($_, $reject) use ($promise) { $reject(new \RuntimeException('Cancelled creating socket during DNS lookup')); // (try to) cancel pending DNS lookup, otherwise ignoring its results - if ($promise instanceof CancellablePromiseInterface) { + if (\method_exists($promise, 'cancel')) { $promise->cancel(); } }