loophp /
iterators
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * For the full copyright and license information, please view |
||
| 5 | * the LICENSE file that was distributed with this source code. |
||
| 6 | */ |
||
| 7 | |||
| 8 | declare(strict_types=1); |
||
| 9 | |||
| 10 | namespace loophp\iterators; |
||
| 11 | |||
| 12 | use Generator; |
||
| 13 | use Iterator; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @template TKey |
||
| 17 | * @template T |
||
| 18 | * |
||
| 19 | * @implements Iterator<TKey, T> |
||
| 20 | */ |
||
| 21 | final class IterableIterator implements Iterator |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var ClosureIterator<TKey, T> |
||
| 25 | */ |
||
| 26 | private ClosureIterator $iterator; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param iterable<TKey, T> $iterable |
||
| 30 | */ |
||
| 31 | 7 | public function __construct(iterable $iterable) |
|
| 32 | { |
||
| 33 | 7 | $this->iterator = new ClosureIterator( |
|
| 34 | /** |
||
| 35 | * @param iterable<TKey, T> $iterable |
||
| 36 | * |
||
| 37 | * @return Generator<TKey, T> |
||
| 38 | */ |
||
| 39 | 7 | static fn (iterable $iterable): Generator => yield from $iterable, |
|
| 40 | 7 | [$iterable] |
|
| 41 | 7 | ); |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return T |
||
| 46 | */ |
||
| 47 | 5 | public function current(): mixed |
|
| 48 | { |
||
| 49 | 5 | return $this->iterator->current(); |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return TKey |
||
|
0 ignored issues
–
show
|
|||
| 54 | */ |
||
| 55 | 2 | public function key(): mixed |
|
| 56 | { |
||
| 57 | 2 | return $this->iterator->key(); |
|
| 58 | } |
||
| 59 | |||
| 60 | 4 | public function next(): void |
|
| 61 | { |
||
| 62 | 4 | $this->iterator->next(); |
|
| 63 | } |
||
| 64 | |||
| 65 | 1 | public function rewind(): void |
|
| 66 | { |
||
| 67 | 1 | $this->iterator->rewind(); |
|
| 68 | } |
||
| 69 | |||
| 70 | 4 | public function valid(): bool |
|
| 71 | { |
||
| 72 | 4 | return $this->iterator->valid(); |
|
| 73 | } |
||
| 74 | } |
||
| 75 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths