You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across a few situations that cause "Refactor foreach to collection" to not work correctly when it decides which variables need to be in use. I've provided detail on each issue below. Thanks!
Issue 1: missing variable from use
Using the main variable $foo in the loop doesn't lead to it being included in use:
I've come across a few situations that cause "Refactor foreach to collection" to not work correctly when it decides which variables need to be in
use
. I've provided detail on each issue below. Thanks!Issue 1: missing variable from
use
Using the main variable
$foo
in the loop doesn't lead to it being included inuse
:Issue 2: duplicate variable in
use
Adding a property accessor to the main variable
$foo
causes the main variable to be included twice inuse
:Issue 3: unnecessary variable in
use
If you have a property accessor on the main variable
$foo
but you don't use the main variable in the loop, it is still included inuse
:If you remove the property accessor from the main variable
$foo
then this issue doesn't happen:The text was updated successfully, but these errors were encountered: