Skip to content

Forward compatibility with react/promise 3 #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

WyriHaximus
Copy link
Member

No description provided.

@WyriHaximus WyriHaximus force-pushed the promise-3 branch 2 times, most recently from 5d6aee7 to 190500f Compare April 26, 2020 17:09
@WyriHaximus WyriHaximus added this to the v1.3.0 milestone Apr 26, 2020
@WyriHaximus WyriHaximus changed the title [WIP] Forward compatibility with react/promise 3 Forward compatibility with react/promise 3 Apr 26, 2020
@WyriHaximus WyriHaximus requested review from clue and jsor April 26, 2020 17:09
@@ -24,7 +25,7 @@ public function query(Query $query)
public function tryQuery(Query $query, $retries)
{
$deferred = new Deferred(function () use (&$promise) {
if ($promise instanceof CancellablePromiseInterface) {
if ($promise instanceof CancellablePromiseInterface || (method_exists($promise, 'cancel') && $promise instanceof PromiseInterface)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well get rid of the instanceof or use the more explicit $promise instanceof CancellablePromiseInterface || (!interface_exists('React\Promise\CancellablePromiseInterface') && \method_exists($promise, 'cancel'). What do you think about this? (see also below) – via https://github.com/reactphp/promise-timer/pull/37/files#r415381931

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants