You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ For further design explanations and notes, please refer to [the meta document](M
18
18
19
19
## Terminology
20
20
21
-
1._Promise_ is an object implementing `Interop\Async\Promise` and conforming to this specification.
22
-
2._Value_ is any legal PHP value (including `null`), but not an instance of `Interop\Async\Promise`.
21
+
1._Promise_ is an object implementing `AsyncInterop\Promise` and conforming to this specification.
22
+
2._Value_ is any legal PHP value (including `null`), but not an instance of `AsyncInterop\Promise`.
23
23
3._Error_ is any value that can be thrown using the `throw` statement.
24
24
4._Reason_ is an error indicating why a `Promise` has failed.
25
25
@@ -39,12 +39,12 @@ A `Promise` is resolved once it either succeeded or failed.
39
39
40
40
## Consumption
41
41
42
-
A `Promise` MUST implement `Interop\Async\Promise` and thus provide a `when()` method to access its current or eventual value or reason.
42
+
A `Promise` MUST implement `AsyncInterop\Promise` and thus provide a `when()` method to access its current or eventual value or reason.
43
43
44
44
```php
45
45
<?php
46
46
47
-
namespace Interop\Async;
47
+
namespace AsyncInterop;
48
48
49
49
/**
50
50
* Representation of the future value of an asynchronous operation.
@@ -81,7 +81,7 @@ Any implementation MUST at least provide these two parameters. The implementatio
81
81
82
82
> **NOTE:** The signature doesn't specify a type for `$error`. This is due to the new `Throwable` interface introduced in PHP 7. As this specification is PHP 5 compatible, we can use neither `Throwable` nor `Exception`.
83
83
84
-
All callbacks registered before the resolution MUST be executed in the order they were registered. Callbacks registered after the resolution MUST be executed immediately. If one of the callbacks throws an `Exception` or `Throwable`, it MUST be forwarded to `Async\Interop\Promise\ErrorHandler::notify`. The `Promise` implementation MUST then continue to call the remaining callbacks with the original parameters.
84
+
All callbacks registered before the resolution MUST be executed in the order they were registered. Callbacks registered after the resolution MUST be executed immediately. If one of the callbacks throws an `Exception` or `Throwable`, it MUST be forwarded to `AsyncInterop\Promise\ErrorHandler::notify`. The `Promise` implementation MUST then continue to call the remaining callbacks with the original parameters.
85
85
86
86
Registered callbacks MUST NOT be called from a file with strict types enabled (`declare(strict_types=1)`).
Fatal error: An exception has been thrown from an Interop\Async\Promise::when handler, but no handler has been registered via Interop\Async\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
12
+
Fatal error: An exception has been thrown from an AsyncInterop\Promise::when handler, but no handler has been registered via AsyncInterop\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
Fatal error: An exception has been thrown from an Interop\Async\Promise::when handler, but no handler has been registered via Interop\Async\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
14
+
Fatal error: An exception has been thrown from an AsyncInterop\Promise::when handler, but no handler has been registered via AsyncInterop\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
Copy file name to clipboardExpand all lines: test/phpt/error_handler_004.phpt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,13 @@ ErrorHandler::notify() converts non-exception to exception
5
5
6
6
require__DIR__ . "/../../vendor/autoload.php";
7
7
8
-
Interop\Async\Promise\ErrorHandler::notify(42);
8
+
AsyncInterop\Promise\ErrorHandler::notify(42);
9
9
10
10
?>
11
11
--EXPECTF--
12
-
Fatal error: An exception has been thrown from an Interop\Async\Promise::when handler, but no handler has been registered via Interop\Async\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
12
+
Fatal error: An exception has been thrown from an AsyncInterop\Promise::when handler, but no handler has been registered via AsyncInterop\Promise\ErrorHandler::set. A handler has to be registered to prevent exceptions from going unnoticed. Do NOT install an empty handler that just does nothing. If the handler is called, there is ALWAYS something wrong.
13
13
14
-
%SException%SPromise implementation called Interop\Async\Promise\ErrorHandler::notify with an invalid argument of type 'integer'%S in %s:%d
14
+
%SException%SPromise implementation called AsyncInterop\Promise\ErrorHandler::notify with an invalid argument of type 'integer'%S in %s:%d
0 commit comments