Skip to content

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

Merged
ondrejmirtes merged 1 commit intophpstan:1.7.xfrom
herndlm:fix-7119
Jun 8, 2022
Merged

Fix node scope resolving of array/list expression assignments#1405
ondrejmirtes merged 1 commit intophpstan:1.7.xfrom
herndlm:fix-7119

Conversation

@herndlm
Copy link
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

Assign readonly property value using list is not handled

2 participants