We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c50edd commit 604ef4cCopy full SHA for 604ef4c
src/Promise.php
@@ -10,7 +10,14 @@ interface Promise
10
/**
11
* Registers a callback to be invoked when the promise is resolved.
12
*
13
- * @param callable(\Throwable|\Exception|null $exception, mixed $result) $onResolved
+ * The callback receives `null` as first parameter and `$value` as second parameter on success. It receives the
14
+ * failure reason as first parameter and `null` as second parameter on failure.
15
+ *
16
+ * If the promise is already resolved, the callback MUST be executed immediately.
17
18
+ * Warning: If you use type declarations for `$value`, be sure to make them accept `null` in case of failures.
19
20
+ * @param callable(\Throwable|\Exception|null $exception, mixed $value) $onResolved Callback to be executed.
21
22
* @return void
23
*/
0 commit comments