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 8.2 compatibility issues in Date
validator
#149
Conversation
Add anonymous classes in tests to avoid setting dynamic properties. Also, inform PHPUnit that some tests will not perform assertions making the output of PHPUnit less verbose. Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
0663807
to
4bcb2b8
Compare
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.
Does psalm already support that false
return value of DateTime#getLastErrors
?
If so, its absolutely okay to early return without actually having a test which verifies if the methods return value is false
is due to the fact that DateTime::getLastErrors
returns an array with warning_count
/error_count
being positive-int or due to the return value false
.
Overall, LGTM.
Related: vimeo/psalm#8478 |
Signed-off-by: George Steel <george@net-glue.co.uk>
@gsteel you actually have to disable Sadly, thats enabled by default. |
@boesing - this should be good to go. The conditional in I did take a quick look at disabling Is it worth trawling through the options and coming up with a standard config for all of the components do you think? |
Yes, but not here :D |
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.
LGTM, thanks @gsteel!
Date
validator
Description
Testing a local project under 8.2-RC reveals a problem specific to the Date validator, where
DateTime::getLastErrors()
is potentially false. Even given https://3v4l.org/HBq0q - I can't get a test to actually return false from this method because it's 8.2 specific, so verifying the fix is a tough one.Looking at https://3v4l.org/3QsKY - Only 8.2 returns false after a date operation that causes no errors.
A couple of other tests had complaints about dynamic properties and I've silenced a number of tests that don't perform any assertions depending on the data providers.