@@ -39,7 +39,7 @@ interface Promise
39
39
* The callback will be called when the value arrived and never more than once.
40
40
*
41
41
* @param callable $onFulfilled Called when a response will be available.
42
- * @param callable $onRejected Called when an error happens .
42
+ * @param callable $onRejected Called when an exception occurs .
43
43
*
44
44
* @return Promise A new resolved promise with value of the executed callback (onFulfilled / onRejected).
45
45
*/
@@ -55,15 +55,17 @@ public function getState();
55
55
/**
56
56
* Wait for the promise to be fulfilled or rejected.
57
57
*
58
- * When this method returns, the request has been resolved and the appropriate callable has terminated.
58
+ * When this method returns, the request has been resolved and if callables have been
59
+ * specified, the appropriate one has terminated.
59
60
*
60
- * When called with the unwrap option, the value is resolved, but not returned.
61
+ * When $unwrap is true (the default), the response is returned, or the exception thrown
62
+ * on failure. Otherwise, nothing is returned or thrown.
61
63
*
62
64
* @param bool $unwrap Whether to return resolved value / throw reason or not
63
65
*
64
66
* @return ResponseInterface|null Resolved value, null if $unwrap is set to false
65
67
*
66
- * @throws \Exception The rejection reason.
68
+ * @throws \Exception The rejection reason if $unwrap is set to true and the request failed .
67
69
*/
68
70
public function wait ($ unwrap = true );
69
71
}
0 commit comments