-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Feature request
ConstantStringType::generalize has this logic:
This means that if you want to combine a list of possible strings into a single type, PHPStan will check every one to see if it could represent a class.
A better approach would be to create a separate ConstantClassStringType (or equivalent name).
Any Foo::class constant would have this type, and its generalize function would be simple, allowing you to strip the class-checking logic from ConstantStringType. It might change the behaviour of the program slightly, but it has a massive impact on PHPStan's memory consumption when evaluating large arrays
Ref #1275
Reactions are currently unavailable