Skip to content

Skip coalsce assign in RemoveUnusedPrivatePropertyRector#4491

Merged
TomasVotruba merged 2 commits intomainfrom
patch-1
Jul 12, 2023
Merged

Skip coalsce assign in RemoveUnusedPrivatePropertyRector#4491
TomasVotruba merged 2 commits intomainfrom
patch-1

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jul 12, 2023

@TomasVotruba TomasVotruba changed the title patch 1 Skip coalsce assign in RemoveUnusedPrivatePropertyRector Jul 12, 2023
@TomasVotruba TomasVotruba merged commit c0983f1 into main Jul 12, 2023
@TomasVotruba TomasVotruba deleted the patch-1 branch July 12, 2023 09:49
Comment on lines +26 to +27
if ($node instanceof Coalesce) {
$node->var->setAttribute(AttributeKey::IS_ASSIGNED_TO, true);
Copy link
Copy Markdown
Member

@samsonasik samsonasik Jul 12, 2023

Choose a reason for hiding this comment

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

I think common AssignOp should be used for it, see + usage at https://getrector.com/demo/807f2ae3-e2c3-4810-9b52-96030125a160

that still removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense 👍 Could you fix 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 will try 👍

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

RemoveUnusedPrivatePropertyRector does not recognize access through ??=

3 participants