Skip to content

Narrow DateInterval->days after DateTimeInterface->diff()#5588

Merged
staabm merged 4 commits intophpstan:2.1.xfrom
staabm:dates
May 3, 2026
Merged

Narrow DateInterval->days after DateTimeInterface->diff()#5588
staabm merged 4 commits intophpstan:2.1.xfrom
staabm:dates

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented May 3, 2026

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented May 3, 2026

//cc @stof

@staabm staabm requested a review from VincentLanglet May 3, 2026 09:00
Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue phpstan/phpstan#1452 is related.

I feel like we could update DateIntervalFormatDynamicReturnTypeExtension to conditionnally use the extra check #4442 (or not) based on the fact days is an int.

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented May 3, 2026

I feel like we could update DateIntervalFormatDynamicReturnTypeExtension to conditionnally use the extra check #4442 (or not) based on the fact days is an int.

I am not sure I can follow. but it seems you have a concrete idea how/what to solve here.
is this something you are willing to adjust in this PR (or maybe you can just do it in a second PR afterwards?)

Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do in the next PR then

@staabm staabm merged commit 86d1207 into phpstan:2.1.x May 3, 2026
655 of 658 checks passed
@staabm staabm deleted the dates branch May 3, 2026 10:00
@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented May 3, 2026

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants