summaryrefslogtreecommitdiff
path: root/vendor/guzzlehttp/promises/src/Each.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/guzzlehttp/promises/src/Each.php')
-rw-r--r--vendor/guzzlehttp/promises/src/Each.php26
1 files changed, 11 insertions, 15 deletions
diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php
index 1dda354..1a7aa0f 100644
--- a/vendor/guzzlehttp/promises/src/Each.php
+++ b/vendor/guzzlehttp/promises/src/Each.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace GuzzleHttp\Promise;
final class Each
@@ -20,17 +22,15 @@ final class Each
* @param mixed $iterable Iterator or array to iterate over.
* @param callable $onFulfilled
* @param callable $onRejected
- *
- * @return PromiseInterface
*/
public static function of(
$iterable,
callable $onFulfilled = null,
callable $onRejected = null
- ) {
+ ): PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
- 'rejected' => $onRejected
+ 'rejected' => $onRejected,
]))->promise();
}
@@ -46,19 +46,17 @@ final class Each
* @param int|callable $concurrency
* @param callable $onFulfilled
* @param callable $onRejected
- *
- * @return PromiseInterface
*/
public static function ofLimit(
$iterable,
$concurrency,
callable $onFulfilled = null,
callable $onRejected = null
- ) {
+ ): PromiseInterface {
return (new EachPromise($iterable, [
- 'fulfilled' => $onFulfilled,
- 'rejected' => $onRejected,
- 'concurrency' => $concurrency
+ 'fulfilled' => $onFulfilled,
+ 'rejected' => $onRejected,
+ 'concurrency' => $concurrency,
]))->promise();
}
@@ -70,19 +68,17 @@ final class Each
* @param mixed $iterable
* @param int|callable $concurrency
* @param callable $onFulfilled
- *
- * @return PromiseInterface
*/
public static function ofLimitAll(
$iterable,
$concurrency,
callable $onFulfilled = null
- ) {
- return each_limit(
+ ): PromiseInterface {
+ return self::ofLimit(
$iterable,
$concurrency,
$onFulfilled,
- function ($reason, $idx, PromiseInterface $aggregate) {
+ function ($reason, $idx, PromiseInterface $aggregate): void {
$aggregate->reject($reason);
}
);