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

Add failing test fixture for SimplifyForeachToCoalescingRector #3073

Conversation

Wohlie
Copy link
Contributor

@Wohlie Wohlie commented Nov 17, 2022

Failing Test for SimplifyForeachToCoalescingRector

Based on https://getrector.org/demo/f9798778-4ed8-46c7-8d25-c4aa36358e82

See rectorphp/rector#7593

@samsonasik
Copy link
Member

@Wohlie could you try provide a patch as well, you should can verify:

  • if the foreach keyVar is an Expr
  • check if the keyVar variable exists in the Foreach_ stmts, with parent node is an ArrayDimFetch

Thank you

@samsonasik
Copy link
Member

samsonasik commented Jan 29, 2023

@Wohlie I cherry-picked your commit at PR #3315

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