diff --git a/README.md b/README.md index ad527fff..28ebf048 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,6 @@ Table of Contents * [PromiseInterface::always()](#promiseinterfacealways) * [PromiseInterface::cancel()](#promiseinterfacecancel) * [Promise](#promise-2) - * [FulfilledPromise](#fulfilledpromise) - * [RejectedPromise](#rejectedpromise) * [Functions](#functions) * [resolve()](#resolve) * [reject()](#reject) @@ -144,6 +142,8 @@ All consumers are notified by having `$onRejected` (which they registered via The promise interface provides the common interface for all promise implementations. +See [Promise](#promise-2) for the only public implementation exposed by this +package. A promise represents an eventual outcome, which is either fulfillment (success) and an associated value, or rejection (failure) and an associated reason. @@ -151,12 +151,6 @@ and an associated value, or rejection (failure) and an associated reason. Once in the fulfilled or rejected state, a promise becomes immutable. Neither its state nor its result (or error) can be modified. -#### Implementations - -* [Promise](#promise-2) -* [FulfilledPromise](#fulfilledpromise) -* [RejectedPromise](#rejectedpromise) - #### PromiseInterface::then() ```php @@ -341,27 +335,6 @@ with that thrown exception as the rejection reason. The resolver function will be called immediately, the canceller function only once all consumers called the `cancel()` method of the promise. -### FulfilledPromise - -Creates a already fulfilled promise. - -```php -$promise = new React\Promise\FulfilledPromise($value); -``` - -Note, that `$value` **cannot** be a promise. It's recommended to use -[resolve()](#resolve) for creating resolved promises. - -### RejectedPromise - -Creates a already rejected promise. - -```php -$promise = new React\Promise\RejectedPromise($reason); -``` - -Note, that `$reason` **must** be a `\Throwable`. - ### Functions Useful functions for creating, joining, mapping and reducing collections of diff --git a/src/FulfilledPromise.php b/src/Internal/FulfilledPromise.php similarity index 89% rename from src/FulfilledPromise.php rename to src/Internal/FulfilledPromise.php index 2bb0a060..e95d5aa4 100644 --- a/src/FulfilledPromise.php +++ b/src/Internal/FulfilledPromise.php @@ -1,7 +1,16 @@