Skip to content

Commit

Permalink
Update CachingIterator, remove newly added @template.
Browse files Browse the repository at this point in the history
Also update `RecursiveCachingIterator`, remove extended methods and constructor that are the same.
  • Loading branch information
drupol committed Jul 21, 2022
1 parent f4da6aa commit 3e0f0b6
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions stubs/CoreGenericIterators.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ abstract class FilterIterator extends IteratorIterator {
* @template-covariant TKey
* @template-covariant TValue
* @template-covariant TIterator as Iterator<TKey, TValue>
* @template TFlags of int-mask<1,2,4,8,16,256>
*
* @template-implements OuterIterator<TKey, TValue>
* @template-implements ArrayAccess<TKey, TValue>
Expand All @@ -359,7 +358,7 @@ class CachingIterator extends IteratorIterator implements OuterIterator , ArrayA

/**
* @param TIterator $iterator
* @param TFlags $flags
* @param int-mask<1,2,4,8,16,256> $flags
*/
public function __construct(Iterator $iterator, int $flags = self::CALL_TOSTRING) {}

Expand All @@ -379,8 +378,6 @@ class CachingIterator extends IteratorIterator implements OuterIterator , ArrayA
public function key() {}

/**
* @psalm-if-this-is self<mixed, mixed, 256>
*
* @return array<array-key, TValue>
*/
public function getCache() {}
Expand Down Expand Up @@ -807,19 +804,6 @@ class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
* @template-extends CachingIterator<TKey, TValue, TIterator>
*/
class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator {

const CALL_TOSTRING = 1 ;
const CATCH_GET_CHILD = 16 ;
const TOSTRING_USE_KEY = 2 ;
const TOSTRING_USE_CURRENT = 4 ;
const TOSTRING_USE_INNER = 8 ;
const FULL_CACHE = 256 ;

/**
* @param TIterator $iterator
* @param int-mask-of<self::*> $flags
*/
public function __construct(Iterator $iterator, int $flags = 0) {}
/**
* @return RecursiveCachingIterator<TKey,TValue, TIterator>
*/
Expand All @@ -829,18 +813,6 @@ class RecursiveCachingIterator extends CachingIterator implements RecursiveItera
* @return bool
*/
public function hasChildren() {}

/**
* @return TValue|null current value or null when iterator is drained
* @psalm-ignore-nullable-return
*/
public function current() {}

/**
* @return TKey|null current key or null when iterator is drained
* @psalm-ignore-nullable-return
*/
public function key() {}
}

/**
Expand Down

0 comments on commit 3e0f0b6

Please sign in to comment.