SimpleFulfilledTestThenable.php 272 B

123456789101112131415
  1. <?php
  2. namespace React\Promise;
  3. class SimpleFulfilledTestThenable
  4. {
  5. public function then(callable $onFulfilled = null, callable $onRejected = null): self
  6. {
  7. if ($onFulfilled) {
  8. $onFulfilled('foo');
  9. }
  10. return new self();
  11. }
  12. }