Skip to content

Commit 58884da

Browse files
authored
Merge pull request #33 from joshdifabio/unify-function-references
Unify function reference styles in docs
2 parents 9882a42 + 6a975a1 commit 58884da

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

META.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The specification proposes `when()` in order to only expose the most primitive c
1414

1515
If implementations wish to adhere to e.g. [Promises/A+ from Javascript](https://promisesaplus.com) (which had been implemented in many PHP Promise libraries at the time of writing this specification) or implement any other methods, they still may do so; `when()` however is the fundamental interoperable primitive every `Promise` is guaranteed to have.
1616

17-
Additionally, coroutines do not use the returned `Promise` of a `then` callback, but returning a `Promise` is required by Promises/A+. Thus there's a lot of useless object creations when using Promises the recommended way, which isn't cheap and adds up. This conflicts with the goal of being as lightweight as possible.
17+
Additionally, coroutines do not use the returned `Promise` of a `then()` callback, but returning a `Promise` is required by Promises/A+. Thus there's a lot of useless object creations when using Promises the recommended way, which isn't cheap and adds up. This conflicts with the goal of being as lightweight as possible.
1818

1919
## Naming
2020

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
66
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
77
interpreted as described in [RFC 2119][].
88

9-
A `Promise` represents the eventual result of an asynchronous operation. Interaction with a `Promise` happens through its `when` method, which registers a callback to receive either a `Promise`'s eventual value or the reason why the `Promise` has failed.
9+
A `Promise` represents the eventual result of an asynchronous operation. Interaction with a `Promise` happens through its `when()` method, which registers a callback to receive either a `Promise`'s eventual value or the reason why the `Promise` has failed.
1010

1111
`Promise` is the fundamental primitive in asynchronous programming. It should be as lightweight as possible, as any cost adds up significantly.
1212

@@ -37,7 +37,7 @@ A `Promise` MUST be in one of three states: `pending`, `succeeded`, `failed`.
3737

3838
## Consumption
3939

40-
A `Promise` MUST implement `Interop\Async\Promise` and thus provide a `when` method to access its current or eventual value or reason.
40+
A `Promise` MUST implement `Interop\Async\Promise` and thus provide a `when()` method to access its current or eventual value or reason.
4141

4242
```php
4343
<?php
@@ -67,15 +67,15 @@ interface Promise
6767
}
6868
```
6969

70-
The `when` method MUST accept at least one argument:
70+
The `when()` method MUST accept at least one argument:
7171

7272
`$callback` – A callable conforming to the following signature:
7373

7474
```php
7575
function($error, $value) { /* ... */ }
7676
```
7777

78-
Any implementation MUST at least provide these two parameters. The implementation MAY extend the `Promise` interface with additional parameters passed to the callback. Further arguments to `when` MUST have default values, so `when` can always be called with only one argument. `when` MAY NOT return a value. `when` MUST NOT throw exceptions bubbling up from a callback invocation.
78+
Any implementation MUST at least provide these two parameters. The implementation MAY extend the `Promise` interface with additional parameters passed to the callback. Further arguments to `when()` MUST have default values, so `when()` can always be called with only one argument. `when()` MAY NOT return a value. `when()` MUST NOT throw exceptions bubbling up from a callback invocation.
7979

8080
> **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`.
8181

0 commit comments

Comments
 (0)