Skip to content

Support union types in curl_setopt validation#4396

Merged
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
staabm:curl-type
Oct 6, 2025
Merged

Support union types in curl_setopt validation#4396
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
staabm:curl-type

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Oct 1, 2025

while working on #4395 I realized there is a low hanging fruit by getting rid of instanceof ConstantIntegerType

@staabm staabm marked this pull request as ready for review October 1, 2025 12:59
@phpstan-bot
Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

continue;
}

$optValueType = TypeCombinator::union($optValueType, $valueType);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be more performant to call ::union just once once we gather all the types to union.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

here you are

@ondrejmirtes ondrejmirtes merged commit f1d4c64 into phpstan:2.1.x Oct 6, 2025
544 of 549 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the curl-type branch October 6, 2025 09:40
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.

3 participants