File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,17 @@ namespace Interop\Async;
49
49
*/
50
50
interface Promise
51
51
{
52
- /**
52
+ /**
53
53
* Registers a callback to be invoked when the promise is resolved.
54
54
*
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.
56
63
*
57
64
* @return void
58
65
*/
Original file line number Diff line number Diff line change 3
3
namespace Interop \Async ;
4
4
5
5
/**
6
- * Promise object representing the future value of an asynchronous operation.
6
+ * Representation of a the future value of an asynchronous operation.
7
7
*/
8
8
interface Promise
9
9
{
You can’t perform that action at this time.
0 commit comments