コード例 #1
0
ファイル: Promise.php プロジェクト: kanzuka/icicle
 /**
  * Resolves this promise with the given promise if this promise is still pending.
  *
  * @param \Icicle\Promise\PromiseInterface $result
  */
 private function resolve(PromiseInterface $result)
 {
     if (null !== $this->result) {
         return;
     }
     $this->result = $result;
     $this->result->done($this->onFulfilled, $this->onRejected ?: new ThenQueue());
     $this->onFulfilled = null;
     $this->onRejected = null;
     $this->onCancelled = null;
 }
コード例 #2
0
ファイル: CancelledPromise.php プロジェクト: kayandrae/icicle
 /**
  * {@inheritdoc}
  */
 public function done(callable $onFulfilled = null, callable $onRejected = null)
 {
     $this->result->done(null, $onRejected);
 }