Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node scope resolving of array/list expression assignments #1405

Merged
merged 1 commit into from Jun 8, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Jun 8, 2022

Closes phpstan/phpstan#7119

By always calling Scope::enterExpressionAssign when $enterExpressionAssign is set, ClassStatementsGatherer::gatherNodes can correctly skip creating PropertyRead on assignments in https://github.com/phpstan/phpstan-src/blob/1.7.11/src/Node/ClassStatementsGatherer.php#L186.

If I'm not completely confused by array destructuring assignments now, then the 2 new reported errors from UnusedPrivatePropertyRuleTest were previously missed and should be correct.

@herndlm herndlm marked this pull request as ready for review June 8, 2022 12:19
@ondrejmirtes ondrejmirtes merged commit db3863a into phpstan:1.7.x Jun 8, 2022
@ondrejmirtes
Copy link
Member

Perfect, thank you :)

@herndlm herndlm deleted the fix-7119 branch June 8, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants