Automattic\WooCommerce\Vendor\GraphQL\Executor\Promise\Adapter
SyncPromise::reject
Method of the class: SyncPromise{}
No Hooks.
Returns
$this.
Usage
$SyncPromise = new SyncPromise(); $SyncPromise->reject( $reason ): self;
- $reason(Throwable) (required)
- .
SyncPromise::reject() SyncPromise::reject code WC 10.9.1
public function reject(\Throwable $reason): self
{
switch ($this->state) {
case self::PENDING:
$this->state = self::REJECTED;
$this->result = $reason;
$this->enqueueWaitingPromises();
break;
case self::REJECTED:
if ($reason !== $this->result) {
throw new \Exception('Cannot change rejection reason.');
}
break;
case self::FULFILLED:
throw new \Exception('Cannot reject fulfilled promise.');
}
return $this;
}