File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
/**
11
11
* Convenience wrapper for promises represented by Promise Adapter.
12
+ * @template T
12
13
*/
13
14
class Promise
14
15
{
@@ -30,6 +31,17 @@ public function __construct($adoptedPromise, PromiseAdapter $adapter)
30
31
$ this ->adapter = $ adapter ;
31
32
}
32
33
34
+ /**
35
+ * @template TFulfilled of mixed
36
+ * @template TRejected of mixed
37
+ * @param (callable(T): (Promise<TFulfilled>|TFulfilled))|null $onFulfilled
38
+ * @param (callable(mixed): (Promise<TRejected>|TRejected))|null $onRejected
39
+ * @return Promise<(
40
+ * $onFulfilled is not null
41
+ * ? ($onRejected is not null ? TFulfilled|TRejected : TFulfilled)
42
+ * : ($onRejected is not null ? TRejected : T)
43
+ * )>
44
+ */
33
45
public function then (?callable $ onFulfilled = null , ?callable $ onRejected = null ): Promise
34
46
{
35
47
return $ this ->adapter ->then ($ this , $ onFulfilled , $ onRejected );
You can’t perform that action at this time.
0 commit comments