Skip to content

MatchExpressionArmBody#1726

Merged
ondrejmirtes merged 3 commits intophpstan:1.8.xfrom
janedbal:match-arm-body
Oct 19, 2022
Merged

MatchExpressionArmBody#1726
ondrejmirtes merged 3 commits intophpstan:1.8.xfrom
janedbal:match-arm-body

Conversation

@janedbal
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

Basically in both cases we should use the scope that's used in processExprNode when processsing the body expr. It's quite intuitive actually :)

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.

I think the correct scope here is the one that's created below in processExprNode call - $matchScope->filterByTruthyValue($filteringExpr) but please test that :)

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.

I think the right scope here is $matchScope. But the one that's correct at the beginning of the foreach, before it's rewritten with $matchScope = $armResult->getScope();.

@ondrejmirtes ondrejmirtes merged commit 6ddf21b into phpstan:1.8.x Oct 19, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

I fixed the issues and merged this. Consider it a gift to your newborn 😄

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