Skip to content

Commit

Permalink
Template params can only have one argument
Browse files Browse the repository at this point in the history
The fact that a promise can also be rejected with a Throwable and/or Exception is implied and there is no need to also define that here.

Refs: reactphp/promise#223
  • Loading branch information
WyriHaximus committed Jan 25, 2023
1 parent 4ba58fb commit 55b44c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ Loop::addTimer(2.0, function () use ($promise) {

### parallel()

The `parallel(iterable<callable():PromiseInterface<mixed,Exception>> $tasks): PromiseInterface<array<mixed>,Exception>` function can be used
The `parallel(iterable<callable():PromiseInterface<mixed>> $tasks): PromiseInterface<array<mixed>>` function can be used
like this:

```php
Expand Down Expand Up @@ -540,7 +540,7 @@ React\Async\parallel([

### series()

The `series(iterable<callable():PromiseInterface<mixed,Exception>> $tasks): PromiseInterface<array<mixed>,Exception>` function can be used
The `series(iterable<callable():PromiseInterface<mixed>> $tasks): PromiseInterface<array<mixed>>` function can be used
like this:

```php
Expand Down Expand Up @@ -582,7 +582,7 @@ React\Async\series([

### waterfall()

The `waterfall(iterable<callable(mixed=):PromiseInterface<mixed,Exception>> $tasks): PromiseInterface<mixed,Exception>` function can be used
The `waterfall(iterable<callable(mixed=):PromiseInterface<mixed>> $tasks): PromiseInterface<mixed>` function can be used
like this:

```php
Expand Down
12 changes: 6 additions & 6 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ function coroutine(callable $function, mixed ...$args): PromiseInterface
}

/**
* @param iterable<callable():PromiseInterface<mixed,Exception>> $tasks
* @return PromiseInterface<array<mixed>,Exception>
* @param iterable<callable():PromiseInterface<mixed>> $tasks
* @return PromiseInterface<array<mixed>>
*/
function parallel(iterable $tasks): PromiseInterface
{
Expand Down Expand Up @@ -711,8 +711,8 @@ function parallel(iterable $tasks): PromiseInterface
}

/**
* @param iterable<callable():PromiseInterface<mixed,Exception>> $tasks
* @return PromiseInterface<array<mixed>,Exception>
* @param iterable<callable():PromiseInterface<mixed>> $tasks
* @return PromiseInterface<array<mixed>>
*/
function series(iterable $tasks): PromiseInterface
{
Expand Down Expand Up @@ -762,8 +762,8 @@ function series(iterable $tasks): PromiseInterface
}

/**
* @param iterable<callable(mixed=):PromiseInterface<mixed,Exception>> $tasks
* @return PromiseInterface<mixed,Exception>
* @param iterable<callable(mixed=):PromiseInterface<mixed>> $tasks
* @return PromiseInterface<mixed>
*/
function waterfall(iterable $tasks): PromiseInterface
{
Expand Down

0 comments on commit 55b44c0

Please sign in to comment.