File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,17 @@ namespace Interop\Async;
4949 */
5050interface Promise
5151{
52- /**
52+ /**
5353 * Registers a callback to be invoked when the promise is resolved.
5454 *
55- * @param callable(\Throwable|\Exception|null $exception, mixed $result) $onResolved
55+ * The callback receives `null` as first parameter and `$value` as second parameter on success. It receives the
56+ * failure reason as first parameter and `null` as second parameter on failure.
57+ *
58+ * If the promise is already resolved, the callback MUST be executed immediately.
59+ *
60+ * Warning: If you use type declarations for `$value`, be sure to make them accept `null` in case of failures.
61+ *
62+ * @param callable(\Throwable|\Exception|null $exception, mixed $value) $onResolved Callback to be executed.
5663 *
5764 * @return void
5865 */
Original file line number Diff line number Diff line change 33namespace Interop \Async ;
44
55/**
6- * Promise object representing the future value of an asynchronous operation.
6+ * Representation of a the future value of an asynchronous operation.
77 */
88interface Promise
99{
You can’t perform that action at this time.
0 commit comments