Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CachingIterator::getCache stub. #8282

Merged
merged 4 commits into from Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>
AndrolGenhald marked this conversation as resolved.
Show resolved Hide resolved
*/
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