Skip to content

Commit 44e9496

Browse files
committed
Make interface in README equal to real interface
1 parent 614ae88 commit 44e9496

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,17 @@ namespace Interop\Async;
4949
*/
5050
interface 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
*/

src/Promise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace 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
*/
88
interface Promise
99
{

0 commit comments

Comments
 (0)