public function reject($reason = null)
{
if (null !== $this->result || $reason === $this) {
return $this->result;
}
return $this->settle(self::doReject($reason));
}
/** * @override * @inheritDoc */ protected function command($params = []) { $runtime = $this->runtime; $promise = new Promise(); $runtime->once('destroy', function () use($promise) { $promise->resolve('Runtime has been destroyed'); }); $runtime->destroy()->then(null, function ($ex) use($promise) { $promise->reject($ex); }, function ($ex) use($promise) { $promise->cancel($ex); }); return $promise; }