Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd243c1d

Browse files
committed
Require PromiseInterface[] as first argument inawaitAll /awaitAny
1 parentba35f85 commitd243c1d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/functions.php‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ function ($error) use (&$exception, &$rejected, &$wait, $loop) {
196196
* value, it will still start a timer and will thus trigger at the earliest
197197
* possible time in the future.
198198
*
199-
* @paramarray $promises
200-
* @param ?LoopInterface $loop
201-
* @param ?float $timeout [deprecated] (optional) maximum timeout in seconds or null=wait forever
199+
* @paramPromiseInterface[] $promises
200+
* @param ?LoopInterface$loop
201+
* @param ?float$timeout [deprecated] (optional) maximum timeout in seconds or null=wait forever
202202
* @return mixed returns whatever the first promise resolves to
203203
* @throws Exception if ALL promises are rejected
204204
* @throws TimeoutException if the $timeout is given and triggers
@@ -287,9 +287,9 @@ function awaitAny(array $promises, LoopInterface $loop = null, $timeout = null)
287287
* value, it will still start a timer and will thus trigger at the earliest
288288
* possible time in the future.
289289
*
290-
* @paramarray $promises
291-
* @param ?LoopInterface $loop
292-
* @param ?float $timeout [deprecated] (optional) maximum timeout in seconds or null=wait forever
290+
* @paramPromiseInterface[] $promises
291+
* @param ?LoopInterface$loop
292+
* @param ?float$timeout [deprecated] (optional) maximum timeout in seconds or null=wait forever
293293
* @return array returns an array with whatever each promise resolves to
294294
* @throws Exception when ANY promise is rejected
295295
* @throws TimeoutException if the $timeout is given and triggers
@@ -322,7 +322,7 @@ function awaitAll(array $promises, LoopInterface $loop = null, $timeout = null)
322322
function_cancelAllPromises(array$promises)
323323
{
324324
foreach ($promisesas$promise) {
325-
if ($promiseinstanceof CancellablePromiseInterface ||(!\interface_exists('React\Promise\CancellablePromiseInterface') &&\method_exists($promise,'cancel'))) {
325+
if ($promiseinstanceofPromiseInterface && ($promiseinstanceofCancellablePromiseInterface ||!\interface_exists('React\Promise\CancellablePromiseInterface'))) {
326326
$promise->cancel();
327327
}
328328
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp