psalm
psalm copied to clipboard
Fix DatePeriod tests for implementing IteratorAggregate
I wrote them in a wrong way in #8312, so they are rewritten now as @AndrolGenhald advised in #8327.
But actually I'm quite surprised Psalm allows me to call getIterator()
on a pure Traversable. It actually results in Fatal Error: https://3v4l.org/MEpb3 (But it's the only one way I've found to test it.)
Looks like PHP 8 stubs indeed leaks to PHP 7 environment somehow.
I was thinking it should be in providerInvalidCodeParse to make sure it has an error, if that test is working fine then it does seem like something is broken.
it should be in providerInvalidCodeParse
I've tried it like that, it yields no error. I mean the test fails with the reason "No CodeException was thrown" or something. So Psalm thinks this code is valid in PHP 7.3 environment.
4.x branch is closed now as we prepare for the 5.0 release. Please target the master branch instead.
Closing as this targets 4.x which is closed. Please reopen on master going forward