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 99
1010/**
1111 * Convenience wrapper for promises represented by Promise Adapter.
12+ * @template T
1213 */
1314class Promise
1415{
@@ -30,6 +31,17 @@ public function __construct($adoptedPromise, PromiseAdapter $adapter)
3031 $ this ->adapter = $ adapter ;
3132 }
3233
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+ */
3345 public function then (?callable $ onFulfilled = null , ?callable $ onRejected = null ): Promise
3446 {
3547 return $ this ->adapter ->then ($ this , $ onFulfilled , $ onRejected );
You can’t perform that action at this time.
0 commit comments