-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improve static analysis tests #153
Conversation
5257ab0
to
9db7b32
Compare
9db7b32
to
f0c8f57
Compare
b142df1
to
849e564
Compare
849e564
to
27228a3
Compare
👀 |
There has been a phpstan release today which is causing some new errors, I'll see if I can sort them out |
Psalm and PHPStan are having some disagreements now on this whole non-empty-string thing 🙄. I bet there's going to be a fix/tweak |
could you use this commit ff9c4b6 as an example to add some "failure cases" for the other operations? If we are not "stress-testing" the type annotations I'm not confident that they are correct or that the static analysis tests are adding any value |
@AlexandruGG I fixed the issue with Do you think we should fix the version of PHPStan until this is fixed upstream? |
Yeah I had that issue as well, yeah let's fix the version for a bit and see what happens |
c205155
to
217d365
Compare
@AlexandruGG I fixed the PHPStan issues, now Psalm complains. Which version of PHPStan do you advice to use? |
e06a298
to
67b0dc6
Compare
5ddf766
to
3065bb8
Compare
* @template V | ||
* @template W |
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 don't understand why this is different from Reduceable.
Same of ScanLeftable and ScanRightable, shouldn't they all be the same?
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.
You're right, there was an inconsistency, I just fixed it.
However, ScanLeft
and ScanRight
might return the initial value if the Iterator is empty, this is why they might return V
or W
but Reduce
and Reduction
will not return anything, this is why it only returns W
.
ScanLeft1
and ScanRight1
uses the first value of the iterator as initial value, so the signature has small differences.
3065bb8
to
cc428ec
Compare
cc428ec
to
ed5a4cd
Compare
Best news of the day! Thanks for the review! |
This PR:
This PR depends on #161