public function then(callable $onFulfilled = null, callable $onRejected = null) { $dependentPromise = new DependentPromise([], $this->getId(), $onFulfilled, $onRejected); $result = $this->wait(false); $promiseData = $dependentPromise->resolve($result); return $promiseData; }
public function then(callable $onFulfilled = null, callable $onRejected = null) { $dependentPromise = new DependentPromise([], $this->getId(), $onFulfilled, $onRejected); $dependentPromiseData = $dependentPromise->getData(); return $dependentPromiseData; }