promisor = $promisor; } /** * @inheritDoc */ public function onResolve(callable $onResolved): void { if (!isset($this->promise)) { \assert($this->promisor !== null); $provider = $this->promisor; $this->promisor = null; $this->promise = async($provider); } \assert($this->promise !== null); $this->promise->onResolve($onResolved); } }