Skip to content

Commit

Permalink
Add InfiniteIterator stub
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 23, 2022
1 parent ce7772d commit 895e90e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/config.neon
Expand Up @@ -28,6 +28,7 @@ parameters:
- AppendIterator
- NoRewindIterator
- LimitIterator
- InfiniteIterator
explicitMixedInUnknownGenericNew: false
explicitMixedForGlobalVariables: false
explicitMixedViaIsArray: false
Expand Down
24 changes: 24 additions & 0 deletions stubs/iterable.stub
Expand Up @@ -345,3 +345,27 @@ class LimitIterator extends IteratorIterator implements OuterIterator {
*/
public function key() {}
}

/**
* @template-covariant TKey
* @template-covariant TValue
* @template TIterator as Iterator<TKey, TValue>
*
* @template-extends IteratorIterator<TKey, TValue, TIterator>
*/
class InfiniteIterator extends IteratorIterator {
/**
* @param TIterator $iterator
*/
public function __construct(Iterator $iterator) {}

/**
* @return TValue
*/
public function current() {}

/**
* @return TKey
*/
public function key() {}
}

0 comments on commit 895e90e

Please sign in to comment.