Skip to content
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

Support integer ranges in sprintf() constant-result inference #3075

Merged
merged 2 commits into from
May 13, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented May 13, 2024

No description provided.

if ($argType instanceof IntegerRangeType) {
foreach ($argType->getFiniteTypes() as $finiteType) {
if (!$finiteType instanceof ConstantIntegerType) {
throw new ShouldNotHappenException();
Copy link
Member

Choose a reason for hiding this comment

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

Instead of this we should add PHPDoc above IntegerRangeType::getFiniteTypes

@ondrejmirtes ondrejmirtes merged commit 0f14aae into phpstan:1.11.x May 13, 2024
112 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the sprintf-range branch May 13, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants