Skip to content
This repository was archived by the owner on Dec 29, 2019. It is now read-only.

Commit c1901aa

Browse files
committed
Fix wrong parameters order
1 parent b7a70a4 commit c1901aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Promise/Future.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function success(ResponseInterface $response)
4343

4444
foreach ($this->callbackQueue as $onResolved) {
4545
$this->resolve(function () use ($onResolved, $response) {
46-
$onResolved($response, null);
46+
$onResolved(null, $response);
4747
});
4848
}
4949
}
@@ -66,7 +66,7 @@ public function failure(Exception $exception)
6666

6767
foreach ($this->callbackQueue as $onResolved) {
6868
$this->resolve(function () use ($onResolved, $exception) {
69-
$onResolved(null, $exception);
69+
$onResolved($exception, null);
7070
});
7171
}
7272
}
@@ -127,13 +127,13 @@ public function when(callable $onResolved)
127127

128128
if ($this->state === self::STATE_SUCCEEDED) {
129129
$this->resolve(function () use ($onResolved) {
130-
$onResolved($this->response, null);
130+
$onResolved(null, $this->response);
131131
});
132132
}
133133

134134
if ($this->state === self::STATE_FAILED) {
135135
$this->resolve(function () use ($onResolved) {
136-
$onResolved(null, $this->exception);
136+
$onResolved($this->exception, null);
137137
});
138138
}
139139
}

0 commit comments

Comments
 (0)