You are here

class NotPromiseInstance in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/tests/NotPromiseInstance.php \GuzzleHttp\Promise\Tests\NotPromiseInstance

Hierarchy

Expanded class hierarchy of NotPromiseInstance

File

vendor/guzzlehttp/promises/tests/NotPromiseInstance.php, line 7

Namespace

GuzzleHttp\Promise\Tests
View source
class NotPromiseInstance extends Thennable implements PromiseInterface {
  private $nextPromise = null;
  public function __construct() {
    $this->nextPromise = new Promise();
  }
  public function then(callable $res = null, callable $rej = null) {
    return $this->nextPromise
      ->then($res, $rej);
  }
  public function otherwise(callable $onRejected) {
    return $this
      ->then($onRejected);
  }
  public function resolve($value) {
    $this->nextPromise
      ->resolve($value);
  }
  public function reject($reason) {
    $this->nextPromise
      ->reject($reason);
  }
  public function wait($unwrap = true, $defaultResolution = null) {
  }
  public function cancel() {
  }
  public function getState() {
    return $this->nextPromise
      ->getState();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NotPromiseInstance::$nextPromise private property Overrides Thennable::$nextPromise
NotPromiseInstance::cancel public function Cancels the promise if possible. Overrides PromiseInterface::cancel
NotPromiseInstance::getState public function Get the state of the promise ("pending", "rejected", or "fulfilled"). Overrides PromiseInterface::getState
NotPromiseInstance::otherwise public function Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. Overrides PromiseInterface::otherwise
NotPromiseInstance::reject public function Reject the promise with the given reason. Overrides PromiseInterface::reject
NotPromiseInstance::resolve public function Resolve the promise with the given value. Overrides Thennable::resolve
NotPromiseInstance::then public function Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. Overrides Thennable::then
NotPromiseInstance::wait public function Waits until the promise completes if possible. Overrides PromiseInterface::wait
NotPromiseInstance::__construct public function Overrides Thennable::__construct
PromiseInterface::FULFILLED constant
PromiseInterface::PENDING constant
PromiseInterface::REJECTED constant