Skip to content

Commit fbb2cf6

Browse files
committed
Merge pull request #1 from php-http/feature/type-hinting
Add type hinting to wait function
2 parents 0cb6f09 + 86b50d7 commit fbb2cf6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/Promise.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Promise;
44

5+
use Psr\Http\Message\ResponseInterface;
6+
57
/**
68
* Promise represents a value that may not be available yet, but will be resolved at some point in future.
79
* It acts like a proxy to the actual value.
@@ -56,11 +58,11 @@ public function getState();
5658
*
5759
* When called with the unwrap option
5860
*
59-
* @param bool $unwrap
61+
* @param bool $unwrap Whether to return resolved value / throw reason or not
6062
*
61-
* @return mixed
63+
* @return ResponseInterface|null Resolved value, null if $unwrap is set to false
6264
*
63-
* @throws \Exception When the rejection reason is an exception.
65+
* @throws \Http\Client\Exception The rejection reason.
6466
*/
6567
public function wait($unwrap = true);
6668
}

0 commit comments

Comments
 (0)