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
Add NoRewindIterator
stub.
#1453
Add NoRewindIterator
stub.
#1453
Conversation
Hi, please just add one stub, make the build green, and wait for feedback. |
Ok will split this in multiple PRs. |
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.
Also - this class needs to be added to parameters.featureToggles.skipCheckGenericClasses
in conf/config.neon.
* | ||
* @template-extends IteratorIterator<TKey, TValue, TIterator> | ||
*/ | ||
class NoRewindIterator extends IteratorIterator { |
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.
This stub is different from the one in Psalm: https://github.com/vimeo/psalm/blob/36d5a2a83c1d7b3e2aca1cfe9e9dcc916619e962/stubs/CoreGenericIterators.phpstub#L581-L604 (This one uses three template types, Psalm uses two). We need to be cross-compatible here.
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.
Note that NoRewindIterator has three templates in the next major of Psalm: https://github.com/vimeo/psalm/blob/master/stubs/CoreGenericIterators.phpstub#L593
(as well as every child of IteratorIterator IIRC)
EDIT: more context here: vimeo/psalm#6970 it originated from a change in phpstan that we duplicated in Psalm but only on our master branch
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.
Oh, I didn't realize that. So I'll recheck the stubs against master.
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.
Indeed, I inspired those PRs from what's in PSalm (@master
branch)
All the other PRs have exactly the same problems so I'm not gonna repeat the reviews there. |
(That's why I asked you to submit only one stub and wait for feedback.) |
In the end, should |
In both Psalm and PHPStan it currently has three (https://github.com/vimeo/psalm/blob/36d5a2a83c1d7b3e2aca1cfe9e9dcc916619e962/stubs/CoreGenericIterators.phpstub#L104-L113) so I don't know why you think it needs to change? |
Just to be sure, nothing else. |
Thank you. |
No description provided.