Skip to content

Commit

Permalink
Merge pull request #8282 from drupol/stub/fix-cachingiterator
Browse files Browse the repository at this point in the history
Update `CachingIterator::getCache` stub.
  • Loading branch information
orklah committed Jul 22, 2022
2 parents f6fb715 + 63b6453 commit 4b2935f
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions stubs/CoreGenericIterators.phpstub
Expand Up @@ -355,7 +355,7 @@ class CachingIterator extends IteratorIterator implements OuterIterator , ArrayA
const TOSTRING_USE_CURRENT = 4 ;
const TOSTRING_USE_INNER = 8 ;
const FULL_CACHE = 256 ;

/**
* @param TIterator $iterator
* @param int-mask-of<self::*> $flags
Expand All @@ -376,6 +376,11 @@ class CachingIterator extends IteratorIterator implements OuterIterator , ArrayA
* @psalm-ignore-nullable-return
*/
public function key() {}

/**
* @return array<array-key, TValue>
*/
public function getCache() {}
}

/**
Expand Down Expand Up @@ -799,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 @@ -821,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 4b2935f

Please sign in to comment.