psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Fix DatePeriod tests for implementing IteratorAggregate

Open fluffycondor opened this issue 2 years ago • 2 comments

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.

fluffycondor avatar Aug 19 '22 14:08 fluffycondor

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.

AndrolGenhald avatar Aug 19 '22 18:08 AndrolGenhald

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.

fluffycondor avatar Aug 19 '22 21:08 fluffycondor

4.x branch is closed now as we prepare for the 5.0 release. Please target the master branch instead.

weirdan avatar Nov 27 '22 11:11 weirdan

Closing as this targets 4.x which is closed. Please reopen on master going forward

orklah avatar Dec 20 '22 18:12 orklah