Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 1, 2026

re-use types introduced in #4841

removes a few TypeCombinator::union calls

grafik

since TypeCombinator::union is the slowest path we have right now, this is a great thing to have.

grafik

@staabm staabm marked this pull request as ready for review February 1, 2026 10:55
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

return $truthy;
}

public static function getNonIntArrayKeyValueType(): Type
Copy link
Contributor

Choose a reason for hiding this comment

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

I think name could be challenged for 3 reasons:

  • Existing methods are called falsey (and truthy) and not getFalseyType.
    Should it be something like nonIntArrayKeyValue ?

  • I had trouble ton understand what was IntArrayKeyValueType and nonIntArrayKeyValueType. Should another name be use ? With offset maybe ?

  • nonInt is not really valid since we was using $offsetType->isInteger()->yes() for getIntArrayKeyValueType and getNonIntArrayKeyValueType in the other case, including the MAYBE case. So it's more a general case.

Maybe something like

generalOffsetAccessible()
intOffsetAccessible()

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