Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 12, 2026

make large enum analysis faster


requires #4744


the repro from phpstan/phpstan#11968

before this PR: 32.32 seconds
after this PR: 8.57 seconds

@staabm staabm marked this pull request as ready for review January 12, 2026 08:28
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Comment on lines +1348 to +1351
if ($finiteType instanceof EnumCaseObjectType) {
$oneType[$finiteType->getClassName() . '::' . $finiteType->getEnumCaseName()] = $finiteType;
continue;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

using the same type description as in

$oneType[$enumCase->getClassName() . '::' . $enumCase->getEnumCaseName()] = $enumCase;

@ondrejmirtes ondrejmirtes merged commit 6373c84 into phpstan:2.1.x Jan 12, 2026
339 of 346 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the fast-inf branch January 12, 2026 08:43
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