adoptedPromise; return new GQLPromise($adoptedPromise->then($onFulfilled, $onRejected), $this); } /** * Create a new promise with the given resolver function. * * @param callable $resolver * @return GQLPromise */ abstract public function create(callable $resolver): GQLPromise; /** * Create a new promise that is fulfilled with the given value. * * @param mixed $value * @return GQLPromise */ abstract public function createFulfilled(mixed $value = null): GQLPromise; /** * Create a new promise that is rejected with the given reason. * * @param mixed $reason * @return GQLPromise */ abstract public function createRejected(mixed $reason): GQLPromise; /** * Create a new promise that resolves when all passed in promises resolve. * * @param array $promisesOrValues * @return GQLPromise */ abstract public function all(array $promisesOrValues): GQLPromise; }