1<?php 2 3namespace React\Promise; 4 5class SimpleFulfilledTestThenable 6{ 7 public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) 8 { 9 try { 10 if ($onFulfilled) { 11 $onFulfilled('foo'); 12 } 13 14 return new self(); 15 } catch (\Throwable $exception) { 16 return new RejectedPromise($exception); 17 } catch (\Exception $exception) { 18 return new RejectedPromise($exception); 19 } 20 } 21} 22