Skip to content

Conversation

ping-yee
Copy link

@VincentLanglet
Copy link
Contributor

If you ignore the error for every remaining array, I assume you won't have an error if you miss an "array" case

Like

  • matching array(int) with only some constant-int
  • matching array(bool, bool) with only 3 cases (instead of four)

Can you add tests to prove it works ?

!$remainingType instanceof NeverType
&& !$this->isUnhandledMatchErrorCaught($node)
&& !$this->hasUnhandledMatchErrorThrowsTag($scope)
&& !$remainingType->isArray()->yes()
Copy link
Member

Choose a reason for hiding this comment

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

This is a bad bugfix. This shuts up the rule for all arrays.

Copy link
Author

Choose a reason for hiding this comment

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

I'm trying to find the right way to fix this. Thanks for the review! @ondrejmirtes @VincentLanglet

@ping-yee ping-yee closed this Sep 2, 2025
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.

False match.unhandled on array with multiple booleans

3 participants