You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
547 B
21 lines
547 B
<?php |
|
|
|
namespace React\Promise; |
|
|
|
class SimpleRejectedTestPromise implements PromiseInterface |
|
{ |
|
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) |
|
{ |
|
try { |
|
if ($onRejected) { |
|
$onRejected('foo'); |
|
} |
|
|
|
return new self(); |
|
} catch (\Throwable $exception) { |
|
return new RejectedPromise($exception); |
|
} catch (\Exception $exception) { |
|
return new RejectedPromise($exception); |
|
} |
|
} |
|
}
|
|
|