-
Notifications
You must be signed in to change notification settings - Fork 510
Fix DateTime::format('u') return type #3919
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
Conversation
This pull request has been marked as ready for review. |
@@ -76,7 +76,7 @@ public function buildReturnTypeFromFormat(string $formatString, bool $useMicrose | |||
return $this->buildNumericRangeType(0, 1, false); | |||
case 'u': | |||
return $useMicrosec | |||
? new IntersectionType([new StringType(), new AccessoryNonFalsyStringType()]) | |||
? new IntersectionType([new StringType(), new AccessoryNumericStringType()]) |
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.
Please keep the non-falsy type as well. Also, you could add type inference for v
.
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.
done
cff8270
to
23515db
Compare
This pull request has been marked as ready for review. |
Thank you. |
fix #2888 and https://phpstan.org/r/251087ce-9f59-4c2b-853b-b7d0c91cc584