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(static fn (): Promise => call($provider)); } \assert($this->promise !== null); $this->promise->onResolve($onResolved); } }