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 2
2
3
3
namespace GraphQL \Executor \Promise ;
4
4
5
- use Amp \Promise as AmpPromise ;
6
5
use GraphQL \Error \InvariantViolation ;
7
6
use GraphQL \Executor \Promise \Adapter \SyncPromise ;
8
7
use React \Promise \PromiseInterface as ReactPromise ;
8
+ use Throwable ;
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,11 @@ public function __construct($adoptedPromise, PromiseAdapter $adapter)
30
31
$ this ->adapter = $ adapter ;
31
32
}
32
33
34
+ /**
35
+ * @param Closure(T):mixed $onfulfilled
36
+ * @param Closure(Throwable):mixed $onRejected
37
+ * @return Promise<T>
38
+ */
33
39
public function then (?callable $ onFulfilled = null , ?callable $ onRejected = null ): Promise
34
40
{
35
41
return $ this ->adapter ->then ($ this , $ onFulfilled , $ onRejected );
You can’t perform that action at this time.
0 commit comments