1212 *
1313 * @author Joel Wurtz <joel.wurtz@gmail.com>
1414 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
15- *
16- * @template-covariant T
1715 */
1816interface Promise
1917{
@@ -38,12 +36,10 @@ interface Promise
3836 * If you do not care about one of the cases, you can set the corresponding callable to null
3937 * The callback will be called when the value arrived and never more than once.
4038 *
41- * @param callable(T): V|null $onFulfilled called when a response will be available
42- * @param callable(\Throwable): V|null $onRejected called when an exception occurs
43- *
44- * @return Promise<V> a new resolved promise with value of the executed callback (onFulfilled / onRejected)
39+ * @param callable|null $onFulfilled called when a response will be available
40+ * @param callable|null $onRejected called when an exception occurs
4541 *
46- * @template V
42+ * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected)
4743 */
4844 public function then (callable $ onFulfilled = null , callable $ onRejected = null );
4945
@@ -65,9 +61,9 @@ public function getState();
6561 *
6662 * @param bool $unwrap Whether to return resolved value / throw reason or not
6763 *
68- * @return ($unwrap is true ? T : null) Resolved value, null if $unwrap is set to false
64+ * @return ($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false
6965 *
70- * @throws \Exception the rejection reason if $unwrap is set to true and the request failed
66+ * @throws \Throwable the rejection reason if $unwrap is set to true and the request failed
7167 */
7268 public function wait ($ unwrap = true );
7369}
0 commit comments