Skip to content

Commit ac2da15

Browse files
authored
Merge pull request #67 from clue-labs/template-types
Use Promise v3 template types
2 parents a406555 + e396716 commit ac2da15

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
steps:
4444
- uses: actions/checkout@v3
4545
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
46-
- name: Run hhvm composer.phar install
46+
- name: Run hhvm composer.phar require react/promise:^2 # downgrade Promise for HHVM
4747
uses: docker://hhvm/hhvm:3.30-lts-latest
4848
with:
49-
args: hhvm composer.phar install
49+
args: hhvm composer.phar require react/promise:^2
5050
- name: Run hhvm vendor/bin/phpunit
5151
uses: docker://hhvm/hhvm:3.30-lts-latest
5252
with:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Timer\timeout(…);
4747

4848
### timeout()
4949

50-
The `timeout(PromiseInterface<mixed> $promise, float $time, ?LoopInterface $loop = null): PromiseInterface<mixed>` function can be used to
50+
The `timeout(PromiseInterface<T> $promise, float $time, ?LoopInterface $loop = null): PromiseInterface<T>` function can be used to
5151
cancel operations that take *too long*.
5252

5353
You need to pass in an input `$promise` that represents a pending operation
@@ -239,7 +239,7 @@ $timer->cancel();
239239

240240
> Deprecated since v1.8.0, see [`sleep()`](#sleep) instead.
241241
242-
The `reject(float $time, ?LoopInterface $loop = null): PromiseInterface<void>` function can be used to
242+
The `reject(float $time, ?LoopInterface $loop = null): PromiseInterface<never>` function can be used to
243243
create a new promise which rejects in `$time` seconds with a `TimeoutException`.
244244

245245
```php

src/functions.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@
129129
* For more details on the promise primitives, please refer to the
130130
* [Promise documentation](https://github.com/reactphp/promise#functions).
131131
*
132-
* @param PromiseInterface<mixed> $promise
132+
* @template T
133+
* @param PromiseInterface<T> $promise
133134
* @param float $time
134135
* @param ?LoopInterface $loop
135-
* @return PromiseInterface<mixed>
136+
* @return PromiseInterface<T>
136137
*/
137138
function timeout(PromiseInterface $promise, $time, LoopInterface $loop = null)
138139
{
@@ -318,7 +319,7 @@ function resolve($time, LoopInterface $loop = null)
318319
*
319320
* @param float $time
320321
* @param LoopInterface $loop
321-
* @return PromiseInterface<void>
322+
* @return PromiseInterface<never>
322323
* @deprecated 1.8.0 See `sleep()` instead
323324
* @see sleep()
324325
*/

0 commit comments

Comments
 (0)