@@ -97,7 +97,7 @@ $deferred = new React\Promise\Deferred();
9797$promise = $deferred->promise();
9898
9999$deferred->resolve(mixed $value = null);
100- $deferred->reject(\Throwable|\Exception $reason);
100+ $deferred->reject(\Throwable $reason);
101101```
102102
103103The ` promise ` method returns the promise of the deferred.
@@ -132,7 +132,7 @@ this promise once it is resolved.
132132#### Deferred::reject()
133133
134134``` php
135- $deferred->reject(\Throwable|\Exception $reason);
135+ $deferred->reject(\Throwable $reason);
136136```
137137
138138Rejects the promise returned by ` promise() ` , signalling that the deferred's
@@ -234,7 +234,7 @@ $promise
234234 // Only catch \RuntimeException instances
235235 // All other types of errors will propagate automatically
236236 })
237- ->otherwise(function ($reason) {
237+ ->otherwise(function (\Throwable $reason) {
238238 // Catch other errors
239239 )};
240240```
@@ -270,7 +270,7 @@ Consider the following synchronous code:
270270``` php
271271try {
272272 return doSomething();
273- } catch(\Exception $e) {
273+ } catch (\Throwable $e) {
274274 return handleError($e);
275275} finally {
276276 cleanup();
@@ -360,7 +360,7 @@ Creates a already rejected promise.
360360$promise = React\Promise\RejectedPromise($reason);
361361```
362362
363- Note, that ` $reason ` ** must** be a ` \Throwable ` or ` \Exception ` .
363+ Note, that ` $reason ` ** must** be a ` \Throwable ` .
364364
365365### Functions
366366
@@ -390,7 +390,7 @@ If `$promiseOrValue` is a promise, it will be returned as is.
390390#### reject()
391391
392392``` php
393- $promise = React\Promise\reject(\Throwable|\Exception $reason);
393+ $promise = React\Promise\reject(\Throwable $reason);
394394```
395395
396396Creates a rejected promise for the supplied ` $reason ` .
@@ -431,7 +431,7 @@ will be the resolution value of the triggering item.
431431The returned promise will only reject if * all* items in ` $promisesOrValues ` are
432432rejected. The rejection value will be a ` React\Promise\Exception\CompositeException `
433433which holds all rejection reasons. The rejection reasons can be obtained with
434- ` CompositeException::getExceptions () ` .
434+ ` CompositeException::getThrowables () ` .
435435
436436The returned promise will also reject with a ` React\Promise\Exception\LengthException `
437437if ` $promisesOrValues ` contains 0 items.
@@ -496,7 +496,7 @@ function getAwesomeResultPromise()
496496 $deferred = new React\Promise\Deferred();
497497
498498 // Execute a Node.js-style function using the callback pattern
499- computeAwesomeResultAsynchronously(function (\Exception $error, $result) use ($deferred) {
499+ computeAwesomeResultAsynchronously(function (\Throwable $error, $result) use ($deferred) {
500500 if ($error) {
501501 $deferred->reject($error);
502502 } else {
@@ -513,7 +513,7 @@ getAwesomeResultPromise()
513513 function ($value) {
514514 // Deferred resolved, do something with $value
515515 },
516- function (\Exception $reason) {
516+ function (\Throwable $reason) {
517517 // Deferred rejected, do something with $reason
518518 }
519519 );
0 commit comments