-
Notifications
You must be signed in to change notification settings - Fork 672
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
fix some iterator stubs #6970
fix some iterator stubs #6970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of those need to pass through the TIterator type parameter:
./stubs/CoreGenericIterators.phpstub|139| class AppendIterator extends IteratorIterator {
./stubs/CoreGenericIterators.phpstub|325| class FilterIterator extends IteratorIterator {
./stubs/CoreGenericIterators.phpstub|349| class CachingIterator extends IteratorIterator implements OuterIterator , ArrayAccess , Countable {
./stubs/CoreGenericIterators.phpstub|533| class InfiniteIterator extends IteratorIterator {
./stubs/CoreGenericIterators.phpstub|560| class LimitIterator extends IteratorIterator implements OuterIterator {
./stubs/CoreGenericIterators.phpstub|587| class NoRewindIterator extends IteratorIterator {
I'm out of luck! Some time ago I used one of those in a test(https://github.com/vimeo/psalm/runs/4293084567?check_suite_focus=true#step:7:133) to show we could use a Generator to populate the templates of the Iterator. This was quite obvious when there was two templates in the Iterator, now that there's three, I'm not sure anymore. I'll see when PHPStan merge the PR what it looks like when I run the test in it and I'll advise |
b3f9ac3
to
bf114f5
Compare
@weirdan mind looking at this one? If it's okay, I'll merge it |
@orklah it's on my todo list along with several other PRs. |
325a99f
to
dcd0537
Compare
Hey hi, I'm testing Psalm 5b1 and I have this new issue:
This comes from there: https://github.com/loophp/iterators/blob/main/src/SimpleCachingIteratorAggregate.php#L28 I'm trying to understand why does |
This fixes some iterator stubs, directly inspired from phpstan/phpstan-src#796
@weirdan can you review this? In particular, I was not sure if I should have used @template-covariant somewhere