Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 22, 2024
1 parent e8fe4a1 commit 402e96f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Runtime/LoopIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ public function __construct($seq)
$this->seq = new \ArrayIterator($seq);
} elseif ($seq instanceof \IteratorAggregate) {
do {
/** @var \Iterator<TKey, TValue> $seq */
$seq = $seq->getIterator();
} while ($seq instanceof \IteratorAggregate);
$this->seq = $seq;
} elseif ($seq instanceof \Iterator) {
/** @var \Iterator<TKey, TValue> $seq */
$this->seq = $seq;

Check failure on line 51 in src/Runtime/LoopIterator.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4)

PHPDoc tag @var with type Iterator<TKey, TValue> is not subtype of native type mixed.
} elseif (is_iterable($seq)) {
$this->seq = new \IteratorIterator($seq);
/** @var \Iterator<TKey, TValue> $seq */
$this->seq = $seq;
} else {
$this->seq = new \EmptyIterator();
}
Expand Down

0 comments on commit 402e96f

Please sign in to comment.