Skip to content

Commit 1d4ad43

Browse files
committed
Change async-interop namespace to AsyncInterop
1 parent 4735056 commit 1d4ad43

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ For further design explanations and notes, please refer to [the meta document](M
1818

1919
## Terminology
2020

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`.
2323
3. _Error_ is any value that can be thrown using the `throw` statement.
2424
4. _Reason_ is an error indicating why a `Promise` has failed.
2525

@@ -39,12 +39,12 @@ A `Promise` is resolved once it either succeeded or failed.
3939

4040
## Consumption
4141

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.
4343

4444
```php
4545
<?php
4646

47-
namespace Interop\Async;
47+
namespace AsyncInterop;
4848

4949
/**
5050
* Representation of the future value of an asynchronous operation.
@@ -81,7 +81,7 @@ Any implementation MUST at least provide these two parameters. The implementatio
8181

8282
> **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`.
8383
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.
8585

8686
Registered callbacks MUST NOT be called from a file with strict types enabled (`declare(strict_types=1)`).
8787

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
},
1414
"autoload": {
1515
"psr-4": {
16-
"Interop\\Async\\": "src"
16+
"AsyncInterop\\": "src"
1717
}
1818
},
1919
"autoload-dev": {
2020
"psr-4": {
21-
"Interop\\Async\\Promise\\Test\\": "test"
21+
"AsyncInterop\\Promise\\Test\\": "test"
2222
}
2323
}
2424
}

src/Promise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Interop\Async;
3+
namespace AsyncInterop;
44

55
/**
66
* Representation of the future value of an asynchronous operation.

src/Promise/ErrorHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace Interop\Async\Promise;
3+
namespace AsyncInterop\Promise;
44

5-
use Interop\Async\Promise;
5+
use AsyncInterop\Promise;
66

77
/**
88
* Global error handler for promises.
@@ -66,8 +66,8 @@ public static function notify($error)
6666

6767
if (self::$callback === null) {
6868
trigger_error(
69-
"An exception has been thrown from an Interop\\Async\\Promise::when handler, but no handler has been"
70-
. " registered via Interop\\Async\\Promise\\ErrorHandler::set. A handler has to be registered to"
69+
"An exception has been thrown from an AsyncInterop\\Promise::when handler, but no handler has been"
70+
. " registered via AsyncInterop\\Promise\\ErrorHandler::set. A handler has to be registered to"
7171
. " prevent exceptions from going unnoticed. Do NOT install an empty handler that just"
7272
. " does nothing. If the handler is called, there is ALWAYS something wrong.\n\n" . (string) $error,
7373
E_USER_ERROR

test/phpt/error_handler_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ ErrorHandler::notify() fatals without a handler
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::notify(new Exception);
8+
AsyncInterop\Promise\ErrorHandler::notify(new Exception);
99

1010
?>
1111
--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.
1313

1414
%s in %s:%d
1515
Stack trace:

test/phpt/error_handler_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ErrorHandler::notify() does not fatal with a handler
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::set(function () { print "1"; });
9-
Interop\Async\Promise\ErrorHandler::notify(new Exception);
8+
AsyncInterop\Promise\ErrorHandler::set(function () { print "1"; });
9+
AsyncInterop\Promise\ErrorHandler::notify(new Exception);
1010

1111
?>
1212
--EXPECT--

test/phpt/error_handler_003.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ ErrorHandler::notify() fatals after handlers have been removed with ErrorHandler
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::set(function () { print "1"; });
9-
Interop\Async\Promise\ErrorHandler::set(null);
10-
Interop\Async\Promise\ErrorHandler::notify(new Exception);
8+
AsyncInterop\Promise\ErrorHandler::set(function () { print "1"; });
9+
AsyncInterop\Promise\ErrorHandler::set(null);
10+
AsyncInterop\Promise\ErrorHandler::notify(new Exception);
1111

1212
?>
1313
--EXPECTF--
14-
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.
1515

1616
%s in %s:%d
1717
Stack trace:

test/phpt/error_handler_004.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ ErrorHandler::notify() converts non-exception to exception
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::notify(42);
8+
AsyncInterop\Promise\ErrorHandler::notify(42);
99

1010
?>
1111
--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.
1313

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
1515
Stack trace:
16-
#0 %s(%d): Interop\Async\Promise\ErrorHandler::notify(%S)
16+
#0 %s(%d): AsyncInterop\Promise\ErrorHandler::notify(%S)
1717
#1 {main} in %s on line %d

test/phpt/error_handler_005.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ ErrorHandler::set() replaces the current handler
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::set(function () { print "1"; });
9-
Interop\Async\Promise\ErrorHandler::set(function () { print "2"; });
10-
Interop\Async\Promise\ErrorHandler::set(function () { print "3"; });
11-
Interop\Async\Promise\ErrorHandler::notify(new Exception);
8+
AsyncInterop\Promise\ErrorHandler::set(function () { print "1"; });
9+
AsyncInterop\Promise\ErrorHandler::set(function () { print "2"; });
10+
AsyncInterop\Promise\ErrorHandler::set(function () { print "3"; });
11+
AsyncInterop\Promise\ErrorHandler::notify(new Exception);
1212

1313
?>
1414
--EXPECT--

test/phpt/error_handler_006.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ ErrorHandler::notify() fatals if handler throws
55

66
require __DIR__ . "/../../vendor/autoload.php";
77

8-
Interop\Async\Promise\ErrorHandler::set(function ($e) { throw $e; });
9-
Interop\Async\Promise\ErrorHandler::notify(new Exception);
8+
AsyncInterop\Promise\ErrorHandler::set(function ($e) { throw $e; });
9+
AsyncInterop\Promise\ErrorHandler::notify(new Exception);
1010

1111
?>
1212
--EXPECTF--
13-
Fatal error: An exception has been thrown from the promise error handler registered to Interop\Async\Promise\ErrorHandler::set().
13+
Fatal error: An exception has been thrown from the promise error handler registered to AsyncInterop\Promise\ErrorHandler::set().
1414

1515
%s in %s:%d
1616
Stack trace:

0 commit comments

Comments
 (0)