Skip to content
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

Use full function namespaces to avoid clashes with serialization #179

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public function otherwise(callable $onRejected): PromiseInterface
public function always(callable $onFulfilledOrRejected): PromiseInterface
{
return $this->then(static function ($value) use ($onFulfilledOrRejected) {
return resolve($onFulfilledOrRejected())->then(function () use ($value) {
return \React\Promise\resolve($onFulfilledOrRejected())->then(function () use ($value) {
return $value;
});
}, static function ($reason) use ($onFulfilledOrRejected) {
return resolve($onFulfilledOrRejected())->then(function () use ($reason) {
return \React\Promise\resolve($onFulfilledOrRejected())->then(function () use ($reason) {
return new RejectedPromise($reason);
});
});
Expand Down Expand Up @@ -146,7 +146,7 @@ private function reject(\Throwable $reason): void
return;
}

$this->settle(reject($reason));
$this->settle(\React\Promise\reject($reason));
}

private function settle(PromiseInterface $result): void
Expand Down Expand Up @@ -223,7 +223,7 @@ private function call(callable $cb): void
$callback(
static function ($value = null) use (&$target) {
if ($target !== null) {
$target->settle(resolve($value));
$target->settle(\React\Promise\resolve($value));
$target = null;
}
},
Expand Down