diff options
Diffstat (limited to 'vendor/guzzlehttp/promises/src/EachPromise.php')
-rw-r--r-- | vendor/guzzlehttp/promises/src/EachPromise.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php index b5cb103..bce6f0f 100644 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -79,20 +79,10 @@ class EachPromise implements PromisorInterface $this->createPromise();
/** @psalm-assert Promise $this->aggregate */
$this->iterable->rewind();
- if (!$this->checkIfFinished()) {
- $this->refillPending();
- }
+ $this->refillPending();
} catch (\Throwable $e) {
- /**
- * @psalm-suppress NullReference
- * @phpstan-ignore-next-line
- */
$this->aggregate->reject($e);
} catch (\Exception $e) {
- /**
- * @psalm-suppress NullReference
- * @phpstan-ignore-next-line
- */
$this->aggregate->reject($e);
}
@@ -107,6 +97,9 @@ class EachPromise implements PromisorInterface {
$this->mutex = false;
$this->aggregate = new Promise(function () {
+ if ($this->checkIfFinished()) {
+ return;
+ }
reset($this->pending);
// Consume a potentially fluctuating list of promises while
// ensuring that indexes are maintained (precluding array_shift).
|