diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55bbaa5..3a56708 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,10 @@ jobs: steps: - uses: actions/checkout@v3 - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM - - name: Run hhvm composer.phar install + - name: Run hhvm composer.phar require react/promise:^2 # downgrade Promise for HHVM uses: docker://hhvm/hhvm:3.30-lts-latest with: - args: hhvm composer.phar install + args: hhvm composer.phar require react/promise:^2 - name: Run hhvm vendor/bin/phpunit uses: docker://hhvm/hhvm:3.30-lts-latest with: diff --git a/README.md b/README.md index 818bc57..230e16d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Timer\timeout(…); ### timeout() -The `timeout(PromiseInterface $promise, float $time, ?LoopInterface $loop = null): PromiseInterface` function can be used to +The `timeout(PromiseInterface $promise, float $time, ?LoopInterface $loop = null): PromiseInterface` function can be used to cancel operations that take *too long*. You need to pass in an input `$promise` that represents a pending operation @@ -239,7 +239,7 @@ $timer->cancel(); > Deprecated since v1.8.0, see [`sleep()`](#sleep) instead. -The `reject(float $time, ?LoopInterface $loop = null): PromiseInterface` function can be used to +The `reject(float $time, ?LoopInterface $loop = null): PromiseInterface` function can be used to create a new promise which rejects in `$time` seconds with a `TimeoutException`. ```php diff --git a/src/functions.php b/src/functions.php index 1e80087..066b44c 100644 --- a/src/functions.php +++ b/src/functions.php @@ -129,10 +129,11 @@ * For more details on the promise primitives, please refer to the * [Promise documentation](https://github.com/reactphp/promise#functions). * - * @param PromiseInterface $promise + * @template T + * @param PromiseInterface $promise * @param float $time * @param ?LoopInterface $loop - * @return PromiseInterface + * @return PromiseInterface */ function timeout(PromiseInterface $promise, $time, LoopInterface $loop = null) { @@ -318,7 +319,7 @@ function resolve($time, LoopInterface $loop = null) * * @param float $time * @param LoopInterface $loop - * @return PromiseInterface + * @return PromiseInterface * @deprecated 1.8.0 See `sleep()` instead * @see sleep() */