Skip to content

Simplify TypeCombinator->processArrayTypes()#4769

Merged
ondrejmirtes merged 3 commits intophpstan:2.1.xfrom
staabm:simple
Jan 16, 2026
Merged

Simplify TypeCombinator->processArrayTypes()#4769
ondrejmirtes merged 3 commits intophpstan:2.1.xfrom
staabm:simple

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Jan 16, 2026

removes some unnecessary work from the hot path

return new NeverType();
}

$types = array_values($types);
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.

hmm .. maybe we could even tag TypeCombinator::union() and TypeCombinator::intersect() as no-named and drop the array_values call?

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.

Yes, please do that next 👍

@ondrejmirtes ondrejmirtes merged commit 10777d5 into phpstan:2.1.x Jan 16, 2026
620 of 645 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the simple branch January 16, 2026 16:17
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