File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace GraphQL \Executor \Promise ;
44
5- use Amp \Promise as AmpPromise ;
65use GraphQL \Error \InvariantViolation ;
76use GraphQL \Executor \Promise \Adapter \SyncPromise ;
87use React \Promise \PromiseInterface as ReactPromise ;
8+ use Throwable ;
99
1010/**
1111 * Convenience wrapper for promises represented by Promise Adapter.
12+ * @template T
1213 */
1314class Promise
1415{
@@ -30,6 +31,11 @@ public function __construct($adoptedPromise, PromiseAdapter $adapter)
3031 $ this ->adapter = $ adapter ;
3132 }
3233
34+ /**
35+ * @param Closure(T):mixed $onfulfilled
36+ * @param Closure(Throwable):mixed $onRejected
37+ * @return Promise<T>
38+ */
3339 public function then (?callable $ onFulfilled = null , ?callable $ onRejected = null ): Promise
3440 {
3541 return $ this ->adapter ->then ($ this , $ onFulfilled , $ onRejected );
You can’t perform that action at this time.
0 commit comments