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 e623a64 commit 9fb518d
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 @@ -277,7 +277,7 @@ trigger at the earliest possible time in the future.

### 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 @@ -319,7 +319,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 @@ -361,7 +361,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 @@ -359,8 +359,8 @@ function coroutine(callable $function, ...$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 @@ -418,8 +418,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 @@ -469,8 +469,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 9fb518d

Please sign in to comment.