YoastSEO_Vendor\GuzzleHttp\Promise
Promise::cancel() public Yoast 1.0
{} Это метод класса: Promise{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$Promise = new Promise(); $Promise->cancel();
Код Promise::cancel() Promise::cancel Yoast 15.6.2
public function cancel()
{
if ($this->state !== self::PENDING) {
return;
}
$this->waitFn = $this->waitList = null;
if ($this->cancelFn) {
$fn = $this->cancelFn;
$this->cancelFn = null;
try {
$fn();
} catch (\Throwable $e) {
$this->reject($e);
} catch (\Exception $e) {
$this->reject($e);
}
}
// Reject the promise only if it wasn't rejected in a then callback.
if ($this->state === self::PENDING) {
$this->reject(new \YoastSEO_Vendor\GuzzleHttp\Promise\CancellationException('Promise has been cancelled'));
}
}