8000 Mark `FulfilledPromise` and `RejectedPromise` as deprecated (Promise v2) by clue · Pull Request #165 · reactphp/promise · GitHub
[go: up one dir, main page]

Skip to content

Mark FulfilledPromise and RejectedPromise as deprecated (Promise v2) #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ Neither its state nor its result (or error) can be modified.
#### Implementations

* [Promise](#promise-2)
* [FulfilledPromise](#fulfilledpromise)
* [RejectedPromise](#rejectedpromise)
* [LazyPromise](#lazypromise)
* [FulfilledPromise](#fulfilledpromise) (deprecated)
* [RejectedPromise](#rejectedpromise) (deprecated)
* [LazyPromise](#lazypromise) (deprecated)

#### PromiseInterface::then()

Expand Down Expand Up @@ -225,9 +225,9 @@ and utility methods which are not part of the Promises/A specification.
#### Implementations

* [Promise](#promise-1)
* [FulfilledPromise](#fulfilledpromise)
* [RejectedPromise](#rejectedpromise)
* [LazyPromise](#lazypromise)
* [FulfilledPromise](#fulfilledpromise) (deprecated)
* [RejectedPromise](#rejectedpromise) (deprecated)
* [LazyPromise](#lazypromise) (deprecated)

#### ExtendedPromiseInterface::done()

Expand Down Expand Up @@ -357,9 +357,9 @@ a promise has no effect.
#### Implementations

* [Promise](#promise-1)
* [FulfilledPromise](#fulfilledpromise)
* [RejectedPromise](#rejectedpromise)
* [LazyPromise](#lazypromise)
* [FulfilledPromise](#fulfilledpromise) (deprecated)
* [RejectedPromise](#rejectedpromise) (deprecated)
* [LazyPromise](#lazypromise) (deprecated)

### Promise

Expand Down Expand Up @@ -409,6 +409,8 @@ once all consumers called the `cancel()` method of the promise.

### FulfilledPromise

> Deprecated in v2.8.0: External usage of `FulfilledPromise` is deprecated, use `resolve()` instead.

Creates a already fulfilled promise.

```php
Expand All @@ -420,6 +422,8 @@ Note, that `$value` **cannot** be a promise. It's recommended to use

### RejectedPromise

> Deprecated in v2.8.0: External usage of `RejectedPromise` is deprecated, use `reject()` instead.

Creates a already rejected promise.

```php
Expand Down
3 changes: 3 additions & 0 deletions src/FulfilledPromise.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace React\Promise;

/**
* @deprecated 2.8.0 External usage of FulfilledPromise is deprecated, use `resolve()` instead.
*/
class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseInterface
{
private $value;
Expand Down
3 changes: 3 additions & 0 deletions src/RejectedPromise.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace React\Promise;

/**
* @deprecated 2.8.0 External usage of RejectedPromise is deprecated, use `reject()` instead.
*/
class RejectedPromise implements ExtendedPromiseInterface, CancellablePromiseInterface
{
private $reason;
Expand Down
0