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