init
This commit is contained in:
21
vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Executable file
21
vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class SimpleFulfilledTestThenable
|
||||
{
|
||||
public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
|
||||
{
|
||||
try {
|
||||
if ($onFulfilled) {
|
||||
$onFulfilled('foo');
|
||||
}
|
||||
|
||||
return new self();
|
||||
} catch (\Throwable $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
} catch (\Exception $exception) {
|
||||
return new RejectedPromise($exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user