Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 13, 2024

another small improvement while thinking thru more details of #3192

it fixes a bug regressed with #3167

@staabm staabm marked this pull request as draft July 13, 2024 07:41
Comment on lines +49 to +56
Copy link
Contributor Author

Choose a reason for hiding this comment

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

regressions from #3167 which made sprintf 1:1 return constant values from arguments (bypassing sprintf formatting rules)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

//cc @pilif

Comment on lines +55 to +58
Copy link
Contributor Author

Choose a reason for hiding this comment

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

improvements because of the added toString() handling

@staabm staabm marked this pull request as ready for review July 13, 2024 08:00
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of building the general return type first and pass it as a default-return into getConstantType() we now invoke getConstantType() first and build the general return type only if we were not able to infer a constant type in the first place

@staabm staabm marked this pull request as draft July 13, 2024 09:37
@staabm staabm marked this pull request as ready for review July 13, 2024 11:52
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 8713b14 into phpstan:1.11.x Jul 14, 2024
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the sprintf5 branch July 14, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants