コード例 #1
0
ファイル: PromiseTest.php プロジェクト: lewishealey/confetti
 public function testOtherwiseIsSugarForRejections()
 {
     $p = new Promise();
     $p->reject('foo');
     $p->otherwise(function ($v) use(&$c) {
         $c = $v;
     });
     P\queue()->run();
     $this->assertEquals($c, 'foo');
 }
コード例 #2
0
ファイル: Coroutine.php プロジェクト: nsandlin/linepig
 public function otherwise(callable $onRejected)
 {
     return $this->result->otherwise($onRejected);
 }