lint/control-flow/no-loop-variable-overwrite
In the code-quality set. Report only. Intent: suspicious. Upstream gates: strictRules.overwriteVariablesWithLoop.
What it does
Disallows a foreach key or value variable overwriting a variable that is already defined.
Configuration
[lint.rules]
"control-flow/no-loop-variable-overwrite" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Replaces
OverwriteVariablesWithForeachRule(phpstan-classes)foreach.keyOverwrite(phpstan-strict-rules)foreach.valueOverwrite(phpstan-strict-rules)